Skip to content

Commit

Permalink
gather createChalkPrototype set
Browse files Browse the repository at this point in the history
  • Loading branch information
alguerocode committed Jul 15, 2023
1 parent a7ee3d7 commit c738c69
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/index.js
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit c738c69

Please sign in to comment.