INNER CODE UNIT · JavaScript
nodeMetadataMap
AscensionGameDev/Intersect-Engine · Intersect.Server/wwwroot/js/assets.js:571
const nodeMetadataMap = new Map(nodes.map(node => {
const depth = countCharacterOccurrences(node.Path, '/');
const nodeIndex = nodes.indexOf(node);
const nextNode = nodes.findLast((n, i) => nodeIndex < i && n.parentId === node.parentId) ?? null;
const lastChild = nextNode === null;
return [
node.id,
{
depth,
lastChild,
},
];
}));
/**
*
* @param {HTMLTableRowElement} row
* @param {LocalStorageBrowseNode} node