From 8076b226d1d227bdb5d1d6fd4e8ec56364a9d228 Mon Sep 17 00:00:00 2001 From: Bikash Tiwari <107907668+BikashMcKinsey@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:27:05 +0530 Subject: [PATCH] Update polyfills.ts If a project does freezing of Array prototypes this breaks it, even tho the node version is greater than 16 --- lib/polyfills.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/polyfills.ts b/lib/polyfills.ts index 4d15e1dc..e5a436ac 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 (!ArrayConstructor.prototype.at) { + var _a; + ArrayConstructor.prototype.at = (_a = ArrayConstructor.prototype.at) !== null && _a !== void 0 ? _a : at; + } });