From c738c69ceab59a44ed7ce559347d73ad344a6ca6 Mon Sep 17 00:00:00 2001 From: Salah Alhashmi Date: Sat, 15 Jul 2023 10:53:33 +0400 Subject: [PATCH] gather createChalkPrototype set --- source/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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();