Add back apply, bind, and call from Function

This commit is contained in:
Linus Unnebäck 2020-03-14 16:21:20 +00:00
parent 797461ee32
commit e3d0e1a16b
No known key found for this signature in database
GPG key ID: CE70CEAE9C0FA66F
2 changed files with 16 additions and 0 deletions

View file

@ -41,6 +41,10 @@ const chalkFactory = options => {
Object.setPrototypeOf(chalk, Chalk.prototype);
Object.setPrototypeOf(chalk.template, chalk);
chalk.template.apply = Function.prototype.apply;
chalk.template.bind = Function.prototype.bind;
chalk.template.call = Function.prototype.call;
chalk.template.constructor = () => {
throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
};