Make chalk/assert shim a Proxy (#15234)

This commit is contained in:
fisker Cheung authored and GitHub committed 2023-08-15 09:11:53 +08:00
1 parent e22a5516f5
commit f24132eda3
2 files changed
+3 -10

No files matched your search

+2 -3
View File
@@ -1,4 +1,3 @@
const assert = () => {};
assert.ok = assert;
assert.strictEqual = assert;
const assert = new Proxy(() => {}, { get: () => assert });
export default assert;
+1 -7
View File
@@ -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;