@ycmd/creds
Version:
LSK.js CLI Creds is the easiest way to manage GitHub / Gitlab secrets and credentials
35 lines (32 loc) • 1.24 kB
JavaScript
;
var chunkU2DZE3DI_js = require('./chunk-U2DZE3DI.js');
var err = require('@lsk4/err');
async function importRequire(path, { removeCache } = {}) {
try {
const res = chunkU2DZE3DI_js.__require(path);
if (removeCache)
delete chunkU2DZE3DI_js.__require.cache[chunkU2DZE3DI_js.__require.resolve(path)];
return res;
} catch (requireErr) {
if (err.Err.getCode(requireErr) === "MODULE_NOT_FOUND") {
throw new err.Err(`${path} not found`, requireErr);
}
const isTryImport = err.Err.getCode(requireErr).startsWith("Dynamic require of") || err.Err.getCode(requireErr).startsWith("ReferenceError: module is not defined in ES module scope");
if (isTryImport) {
try {
const res = await import(path);
return res;
} catch (importErr) {
if (err.Err.getCode(importErr) === "ERR_MODULE_NOT_FOUND") {
throw new err.Err(`${path} not found`, importErr);
}
throw new err.Err("importErr", importErr);
}
}
throw new err.Err("requireErr", requireErr);
}
}
chunkU2DZE3DI_js.__name(importRequire, "importRequire");
exports.importRequire = importRequire;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-XPIAUU4D.js.map