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

Method resolve

tools/common/_hyperscript.iife.js:5564–5584  ·  view source on GitHub ↗
(ctx, { expr, constructorArgs } = {})

Source from the content-addressed store, hash-verified

5562 }
5563 }
5564 resolve(ctx, { expr, constructorArgs } = {}) {
5565 if (this.variant === "queryRef") {
5566 var match, tagname = "div", id, classes = [];
5567 var re = /(?:(^|#|\.)([^#\. ]+))/g;
5568 while (match = re.exec(this.expr.css)) {
5569 if (match[1] === "") tagname = match[2].trim();
5570 else if (match[1] === "#") id = match[2].trim();
5571 else classes.push(match[2].trim());
5572 }
5573 var result = document.createElement(tagname);
5574 if (id !== void 0) result.id = id;
5575 result.classList.add(...classes);
5576 ctx.result = result;
5577 } else {
5578 ctx.result = new expr(...constructorArgs);
5579 }
5580 if (this.target) {
5581 ctx.meta.runtime.setSymbol(this.target.name, ctx, this.target.scope, ctx.result);
5582 }
5583 return this.findNext(ctx);
5584 }
5585 };
5586 var AppendCommand = class _AppendCommand extends Command {
5587 static keyword = "append";

Callers

nothing calls this directly

Calls 2

setSymbolMethod · 0.45
findNextMethod · 0.45

Tested by

no test coverage detected