Skip to content

Commit

Permalink
Make chalk/assert shim a Proxy (#15234)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Aug 15, 2023
1 parent e22a551 commit f24132e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 2 additions & 3 deletions scripts/build/shims/assert.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const assert = () => {};
assert.ok = assert;
assert.strictEqual = assert;
const assert = new Proxy(() => {}, { get: () => assert });

export default assert;
8 changes: 1 addition & 7 deletions scripts/build/shims/chalk.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
const chalk = (x) => x;
chalk.grey = chalk;
chalk.red = chalk;
chalk.bold = chalk;
chalk.yellow = chalk;
chalk.blue = chalk;
chalk.default = chalk;
const chalk = new Proxy(String, { get: () => chalk });

export default chalk;

0 comments on commit f24132e

Please sign in to comment.