MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / getParentURL

Method getParentURL

tools/mcpack.js:623–631  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

621// URL
622
623 getParentURL(href) {
624 const url = new URL(href);
625 let path = url.pathname;
626 if (path) {
627 let slash = path.lastIndexOf('/');
628 url.pathname = path.slice(0, slash);
629 return url.toString();
630 }
631 }
632 isPathInvalid(path, index) {
633 let split = path.split('/');
634 if (index > 0)

Callers 2

PACKAGE_RESOLVEMethod · 0.80
LOOKUP_PACKAGE_SCOPEMethod · 0.80

Calls 2

toStringMethod · 0.95
sliceMethod · 0.65

Tested by

no test coverage detected