Fix proto errors maybe
This commit is contained in:
parent
aff39e4b1b
commit
95d13499d4
@ -22,13 +22,22 @@ export function objectMap<SV, TV>(srcObj: { [index: string]: SV }, callback: (va
|
|||||||
|
|
||||||
if (!Object.prototype.forEach)
|
if (!Object.prototype.forEach)
|
||||||
Object.defineProperty(Object.prototype, "forEach", {
|
Object.defineProperty(Object.prototype, "forEach", {
|
||||||
value: objectForEach,
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
value: function (cb) {
|
||||||
|
return objectForEach(this, cb);
|
||||||
|
},
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!Object.prototype.map)
|
if (!Object.prototype.map)
|
||||||
Object.defineProperty(Object.prototype, "map", {
|
Object.defineProperty(Object.prototype, "map", {
|
||||||
value: objectMap,
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
value: function (cb) {
|
||||||
|
return objectMap(this, cb);
|
||||||
|
},
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user