From 6b5110e7839e1cd9827aedab4fa1675c11916328 Mon Sep 17 00:00:00 2001 From: "Siddharth Gelera (reaper)" Date: Fri, 12 Apr 2024 15:29:47 +0530 Subject: [PATCH 1/2] Update polyfills.ts Signed-off-by: Reaper Gelera --- lib/polyfills.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/polyfills.ts b/lib/polyfills.ts index 4d15e1dc..504e0eb9 100644 --- a/lib/polyfills.ts +++ b/lib/polyfills.ts @@ -46,5 +46,8 @@ const ArrayConstructors = [ ]; ArrayConstructors.forEach((ArrayConstructor) => { - ArrayConstructor.prototype.at = ArrayConstructor.prototype.at ?? at; + if (!Object.prototype.hasOwnProperty.call(ArrayConstructor, "at")) { + ArrayConstructor.prototype.at = at; + } }); + From b4b4f9fb26a46a64e52d90229f0e9ab800475bc0 Mon Sep 17 00:00:00 2001 From: Reaper Gelera Date: Fri, 12 Apr 2024 22:08:26 +0530 Subject: [PATCH 2/2] chore: style fix --- lib/polyfills.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/polyfills.ts b/lib/polyfills.ts index 504e0eb9..4d2c5632 100644 --- a/lib/polyfills.ts +++ b/lib/polyfills.ts @@ -46,8 +46,7 @@ const ArrayConstructors = [ ]; ArrayConstructors.forEach((ArrayConstructor) => { - if (!Object.prototype.hasOwnProperty.call(ArrayConstructor, "at")) { + if (!Object.prototype.hasOwnProperty.call(ArrayConstructor, 'at')) { ArrayConstructor.prototype.at = at; } }); -