From 438f32698ecafcfbce413c5820ccbf2cb78faae8 Mon Sep 17 00:00:00 2001 From: Tom Sherman Date: Sat, 26 Jan 2019 21:47:59 +0000 Subject: [PATCH] Replace Chalk.constructor() with deprecation error --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0de53d9..fedadd0 100644 --- a/index.js +++ b/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;