refactor: rename ployfill to polyfill

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-03-26 16:17:13 +08:00
parent 3ccc9b3d06
commit 784ea2d65a
12 changed files with 18 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
// ES2015 String ployfill must force overwrite to js method
Object.defineProperty(String.prototype, 'contains', {
value: require(`es5-ext/string/#/contains/shim`),
configurable: true,
enumerable: false,
writable: true
})
Object.defineProperty(String.prototype, 'repeat', {
value: require(`es5-ext/string/#/repeat/shim`),
configurable: true,
enumerable: false,
writable: true
})
Object.defineProperty(String.prototype, 'startsWith', {
value: require(`es5-ext/string/#/starts-with/shim`),
configurable: true,
enumerable: false,
writable: true
})
Object.defineProperty(String.prototype, 'endsWith', {
value: require(`es5-ext/string/#/ends-with/shim`),
configurable: true,
enumerable: false,
writable: true
})