MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / _createIdMaps

Function _createIdMaps

tools/common/_hyperscript.iife.js:3549–3557  ·  view source on GitHub ↗
(oldNode, newContent)

Source from the content-addressed store, hash-verified

3547 return !oldNode.id || oldNode.id === newNode.id;
3548 }
3549 function _createIdMaps(oldNode, newContent) {
3550 var oldIdElements = _queryEltAndDescendants(oldNode, "[id]");
3551 var newIdElements = newContent.querySelectorAll("[id]");
3552 var persistentIds = _createPersistentIds(oldIdElements, newIdElements);
3553 var idMap = /* @__PURE__ */ new Map();
3554 _populateIdMapWithTree(idMap, persistentIds, oldNode.parentElement, oldIdElements);
3555 _populateIdMapWithTree(idMap, persistentIds, newContent, newIdElements);
3556 return { persistentIds, idMap };
3557 }
3558 function _createPersistentIds(oldIdElements, newIdElements) {
3559 var duplicateIds = /* @__PURE__ */ new Set(), oldIdTagNameMap = /* @__PURE__ */ new Map();
3560 for (var { id, tagName } of oldIdElements) {

Callers 1

morphMethod · 0.70

Calls 3

_queryEltAndDescendantsFunction · 0.70
_createPersistentIdsFunction · 0.70
_populateIdMapWithTreeFunction · 0.70

Tested by

no test coverage detected