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

Function _createIdMaps

www/js/_hyperscript.js:3709–3717  ·  view source on GitHub ↗
(oldNode, newContent)

Source from the content-addressed store, hash-verified

3707 return !oldNode.id || oldNode.id === newNode.id;
3708 }
3709 function _createIdMaps(oldNode, newContent) {
3710 var oldIdElements = _queryEltAndDescendants(oldNode, "[id]");
3711 var newIdElements = newContent.querySelectorAll("[id]");
3712 var persistentIds = _createPersistentIds(oldIdElements, newIdElements);
3713 var idMap = /* @__PURE__ */ new Map();
3714 _populateIdMapWithTree(idMap, persistentIds, oldNode.parentElement, oldIdElements);
3715 _populateIdMapWithTree(idMap, persistentIds, newContent, newIdElements);
3716 return { persistentIds, idMap };
3717 }
3718 function _createPersistentIds(oldIdElements, newIdElements) {
3719 var duplicateIds = /* @__PURE__ */ new Set(), oldIdTagNameMap = /* @__PURE__ */ new Map();
3720 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