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

Method assignToNamespace

www/js/_hyperscript.js:2529–2546  ·  view source on GitHub ↗
(elt, nameSpace, name, value)

Source from the content-addressed store, hash-verified

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

Callers 2

installMethod · 0.45
installMethod · 0.45

Calls 1

Tested by

no test coverage detected