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

Method resolve

www/js/_hyperscript.esm.js:5954–5975  ·  view source on GitHub ↗
(context, args)

Source from the content-addressed store, hash-verified

5952 return new _AppendCommand(value, targetExpr, assignable);
5953 }
5954 resolve(context, args) {
5955 var { target, value, ...lhs } = args;
5956 if (Array.isArray(target)) {
5957 target.push(value);
5958 context.meta.runtime.notifyMutation(target);
5959 } else if (target instanceof Set) {
5960 target.add(value);
5961 context.meta.runtime.notifyMutation(target);
5962 } else if (target instanceof Element) {
5963 if (value instanceof Element) {
5964 target.insertAdjacentElement("beforeend", value);
5965 } else {
5966 target.insertAdjacentHTML("beforeend", value);
5967 }
5968 context.meta.runtime.processNode(target);
5969 } else if (this.assignable) {
5970 this._target.set(context, lhs, (target || "") + value);
5971 } else {
5972 throw new Error("Unable to append a value!");
5973 }
5974 return this.findNext(context);
5975 }
5976};
5977var PickCommand = class _PickCommand extends Command {
5978 static keyword = "pick";

Callers

nothing calls this directly

Calls 4

notifyMutationMethod · 0.45
processNodeMethod · 0.45
setMethod · 0.45
findNextMethod · 0.45

Tested by

no test coverage detected