From 95d13499d4ab746fc937cd0efc10d84f6d51a820 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 17 Oct 2025 03:30:12 +0200 Subject: [PATCH] Fix proto errors maybe --- src/util/util/extensions/Object.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/util/util/extensions/Object.ts b/src/util/util/extensions/Object.ts index 17a2204f..bda4ccf2 100644 --- a/src/util/util/extensions/Object.ts +++ b/src/util/util/extensions/Object.ts @@ -22,13 +22,22 @@ export function objectMap(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, });