Replace Chalk.constructor() with deprecation error

This commit is contained in:
Tom Sherman 2019-01-26 21:47:59 +00:00
parent f66f1c09ea
commit 438f32698e

View file

@ -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;