diff --git a/source/index.js b/source/index.js index a40a1a1..4bd2d7c 100644 --- a/source/index.js +++ b/source/index.js @@ -42,8 +42,6 @@ function createChalk(options) { return chalkFactory(options); } -Object.setPrototypeOf(createChalk.prototype, Function.prototype); - const styles = Object.create(null); for (const [styleName, style] of Object.entries(ansiStyles)) { @@ -192,6 +190,7 @@ const applyStyle = (self, string) => { return openAll + string + closeAll; }; +Object.setPrototypeOf(createChalk.prototype, Function.prototype); Object.defineProperties(createChalk.prototype, styles); const chalk = createChalk();