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

Method urlToDirectoryPath

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

Source from the content-addressed store, hash-verified

653 return "file://" + path;
654 }
655 urlToDirectoryPath(href) {
656 const url = new URL(href);
657 if (url.protocol == "file:") {
658 let path = url.pathname;
659 if (this.windows)
660 path = path.slice(1).replaceAll('/', '\\');
661 if (this.isDirectoryOrFile(path) == -1)
662 return path;
663 }
664 }
665 urlToFilePath(href) {
666 const url = new URL(href);
667 if (url.protocol == "file:") {

Callers 2

runMethod · 0.80
PACKAGE_RESOLVEMethod · 0.80

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected