swap-lock-registry
Version:
A CLI tool to swap the registry URL in the lock file without having to remove it
18 lines (17 loc) • 752 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.traitFiles = void 0;
const npm_1 = require("./npm");
const yarn_1 = require("./yarn");
const logger_1 = require("./logger");
async function traitFiles(lockFiles, options) {
if (options.parallel) {
await Promise.all(lockFiles.map((file) => (options.yarn ? yarn_1.traitYarnLockFile : npm_1.traitNpmLockFile)(file, options).catch((error) => logger_1.logger.error(file, error.message))));
}
else {
for (const file of lockFiles) {
await (options.yarn ? yarn_1.traitYarnLockFile : npm_1.traitNpmLockFile)(file, options).catch((error) => logger_1.logger.error(file, error.message));
}
}
}
exports.traitFiles = traitFiles;