delete more unused code

This commit is contained in:
Joeri Exelmans 2025-05-08 17:32:34 +02:00
parent 07d313f938
commit d9111c3969

View file

@ -7,25 +7,6 @@ export function capitalizeFirstLetter(val) {
return String(val).charAt(0).toUpperCase() + String(val).slice(1); 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 => { export const memoize = callback => {
let called = false let called = false
let result; let result;