MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / assignToNamespace

Method assignToNamespace

www/js/_hyperscript-max.js:2528–2545  ·  view source on GitHub ↗
(elt, nameSpace, name, value)

Source from the content-addressed store, hash-verified

2526 return this.#flatGet(root, property, (root2, property2) => getComputedStyle(root2).getPropertyValue(property2));
2527 }
2528 assignToNamespace(elt, nameSpace, name, value) {
2529 let root;
2530 if (elt == null || typeof document !== "undefined" && elt === document.body) {
2531 root = this.#globalScope;
2532 } else {
2533 root = this.getHyperscriptFeatures(elt);
2534 }
2535 var propertyName;
2536 while ((propertyName = nameSpace.shift()) !== void 0) {
2537 var newRoot = root[propertyName];
2538 if (newRoot == null) {
2539 newRoot = {};
2540 root[propertyName] = newRoot;
2541 }
2542 root = newRoot;
2543 }
2544 root[name] = value;
2545 }
2546 // =================================================================
2547 // Collection and iteration utilities
2548 // =================================================================

Callers 5

installMethod · 0.45
installMethod · 0.45
installMethod · 0.45
installMethod · 0.45
installMethod · 0.45

Calls 1

Tested by

no test coverage detected