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

Method resolve

www/js/_hyperscript.js:6420–6440  ·  view source on GitHub ↗
(ctx, { target: to, offset })

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_resolveScrollFunction · 0.70
findNextMethod · 0.45

Tested by

no test coverage detected