@notadd/injection
Version:
Notadd Injection Package.
24 lines (22 loc) • 667 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const fs_1 = require("fs");
function getPackagePathByAddon(addon) {
function getPath(base) {
if (base.length === 0) {
return "";
}
else {
if (fs_1.existsSync(path_1.join(base, "package.json"))) {
return base;
}
else {
return getPath(path_1.dirname(base));
}
}
}
return getPath(path_1.dirname(addon.location));
}
exports.getPackagePathByAddon = getPackagePathByAddon;
//# sourceMappingURL=get-package-path-by-addon.js.map