Replace Chalk.constructor() with deprecation error
This commit is contained in:
parent
f66f1c09ea
commit
438f32698e
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -40,7 +40,7 @@ function chalkFactory(options) {
|
|||
Object.setPrototypeOf(chalk, Chalk.prototype);
|
||||
Object.setPrototypeOf(chalk.template, chalk);
|
||||
|
||||
chalk.template.constructor = Chalk;
|
||||
chalk.template.constructor = () => {throw new Error('Chalk.constructor() is deprecated. Use new Chalk.instance() instead.')};
|
||||
chalk.template.instance = ChalkClass;
|
||||
|
||||
return chalk.template;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue