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

Method resolve

www/js/_hyperscript-max.js:5955–5976  ·  view source on GitHub ↗
(context, args)

Source from the content-addressed store, hash-verified

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