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

Method urlToFilePath

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

Source from the content-addressed store, hash-verified

663 }
664 }
665 urlToFilePath(href) {
666 const url = new URL(href);
667 if (url.protocol == "file:") {
668 let path = url.pathname;
669 if (this.windows)
670 path = path.slice(1).replaceAll('/', '\\');
671 if (this.isDirectoryOrFile(path) == 1)
672 return path;
673 }
674 }
675 validateURL(href) {
676 try {
677 const url = new URL(href);

Callers 5

parseModuleMethod · 0.80
runMethod · 0.80
ESM_RESOLVEMethod · 0.80
LOOKUP_PACKAGE_SCOPEMethod · 0.80
READ_PACKAGE_JSONMethod · 0.80

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected