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

Method resolve

www/js/_hyperscript-max.js:6419–6439  ·  view source on GitHub ↗
(ctx, { target: to, offset })

Source from the content-addressed store, hash-verified

6417 return new _GoCommand(target, null, false, newWindow);
6418 }
6419 resolve(ctx, { target: to, offset }) {
6420 if (this.back) {
6421 window.history.back();
6422 } else if (this.scrollOptions) {
6423 _resolveScroll(ctx, to, offset, this.plusOrMinus, this.scrollOptions);
6424 } else if (to != null) {
6425 if (to instanceof Element) {
6426 to.scrollIntoView({ block: "start", inline: "nearest" });
6427 } else {
6428 var str = String(to);
6429 if (str.startsWith("#")) {
6430 window.location.hash = str;
6431 } else if (this.newWindow) {
6432 window.open(str);
6433 } else {
6434 window.location.href = str;
6435 }
6436 }
6437 }
6438 return this.findNext(ctx);
6439 }
6440 };
6441
6442 // src/parsetree/commands/setters.js

Callers

nothing calls this directly

Calls 2

_resolveScrollFunction · 0.70
findNextMethod · 0.45

Tested by

no test coverage detected