MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / LOOKUP_PACKAGE_SCOPE

Method LOOKUP_PACKAGE_SCOPE

tools/mcpack.js:957–968  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

955 }
956 }
957 LOOKUP_PACKAGE_SCOPE(url) {
958 let scopeURL = url;
959 while (scopeURL != "file:///") {
960 scopeURL = this.getParentURL(scopeURL);
961 if (scopeURL.endsWith("/node_modules"))
962 return null;
963 let pjsonURL = scopeURL + "/package.json";
964 if (this.urlToFilePath(pjsonURL))
965 return scopeURL;
966 }
967 return null;
968 }
969 READ_PACKAGE_JSON(packageURL) {
970 let pjson = this.packages.get(packageURL);
971 if (pjson !== undefined)

Callers 4

parseModuleMethod · 0.80
PACKAGE_SELF_RESOLVEMethod · 0.80
ESM_FILE_FORMATMethod · 0.80

Calls 2

getParentURLMethod · 0.80
urlToFilePathMethod · 0.80

Tested by

no test coverage detected