From d9111c396912ee2a030ba4c87f18bcf222a53b3d Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Thu, 8 May 2025 17:32:34 +0200 Subject: [PATCH] delete more unused code --- lib/util/util.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/util/util.js b/lib/util/util.js index 48c4f01..9bbd332 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -7,25 +7,6 @@ export function capitalizeFirstLetter(val) { return String(val).charAt(0).toUpperCase() + String(val).slice(1); } -const _mapRecursiveStructure = mapping => transform => root => { - const found = mapping.get(root); - if (found) { - // already mapped - // return existing result to prevent endless recursion - return found; - } - // note the indirection (wrapped in lamda), this allows the user to recursively map the children (which may refer to the root) without yet having finished mapping the root. - let memo; - const result = () => { - // memoization is necessary for correctness - return memo || (memo = transform(root, _mapRecursiveStructure(mapping)(transform))); - }; - mapping.set(root, result); - return result; -}; - -export const mapRecursiveStructure = _mapRecursiveStructure(new Map()); - export const memoize = callback => { let called = false let result;