From 474959fbf2c2dc994fe836965d7f6a2717053f5b Mon Sep 17 00:00:00 2001 From: Darryl Yeo Date: Thu, 25 May 2023 22:10:38 -0700 Subject: [PATCH] Re-enable Array#groupToMap shim --- src/routes/+layout.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/routes/+layout.js b/src/routes/+layout.js index ec2cafd8..e55dd8a6 100644 --- a/src/routes/+layout.js +++ b/src/routes/+layout.js @@ -11,21 +11,21 @@ globalThis.process = process // Shims // import shimArrayPrototypeGroup from 'array.prototype.group' -// import shimArrayPrototypeGroupToMap from 'array.prototype.grouptomap' +import shimArrayPrototypeGroupToMap from 'array.prototype.grouptomap' // shimArrayPrototypeGroup.shim() -// shimArrayPrototypeGroupToMap.shim() - -Array.prototype.groupToMap ||= function(callbackFn, _this = this){ - const map = new Map() - for (const item of _this) { - const key = callbackFn(item) - const group = map.get(key) || [] - group.push(item) - map.set(key, group) - } - return map -} +shimArrayPrototypeGroupToMap.shim() + +// Array.prototype.groupToMap ||= function(callbackFn, _this = this){ +// const map = new Map() +// for (const item of _this) { +// const key = callbackFn(item) +// const group = map.get(key) || [] +// group.push(item) +// map.set(key, group) +// } +// return map +// } // SvelteKit