Fix proto errors maybe

This commit is contained in:
Rory& 2025-10-17 03:30:12 +02:00
parent aff39e4b1b
commit 95d13499d4

View File

@ -22,13 +22,22 @@ export function objectMap<SV, TV>(srcObj: { [index: string]: SV }, callback: (va
if (!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,
writable: true,
});
if (!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,
writable: true,
});