This commit is contained in:
silverwind 2020-03-08 15:54:40 +01:00
parent 8262307302
commit ef43d4e57d
Signed by: silverwind
GPG Key ID: 2E62B41C93869443
2 changed files with 4 additions and 6 deletions

1
.yarnrc Normal file

@ -0,0 +1 @@
--install.no-lockfile true

@ -28,7 +28,7 @@ const stripRe = /^.*?:\/\/(.*?@)?(github\.com[:/])/i;
const partsRe = /^([^/]+)\/([^/#]+)?.*?([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i;
const hashRe = /^[0-9a-f]+$/i;
const memoize = (fn) => {
const memoize = fn => {
const cache = {};
return (arg, arg2) => cache[arg] || (cache[arg] = fn(arg, arg2));
};
@ -37,6 +37,7 @@ const esc = str => str.replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&");
const gitInfo = memoize(fromUrl);
const registryAuthToken = memoize(rat);
const registryUrl = memoize(ru);
const normalizeRegistryUrl = memoize(url => url.endsWith("/") ? url.substring(0, url.length - 1) : url);
const args = minimist(process.argv.slice(2), {
boolean: [
@ -165,7 +166,7 @@ if (args.file) {
} else {
packageFile = findUp.sync("package.json");
if (!packageFile) {
finish(new Error(`Unable to find package.json in ${process.cwd()} or any of its parent directories`));
finish(new Error(`Unable to find package.json in working directory or any of its parents`));
}
}
@ -354,10 +355,6 @@ function write(file, content) {
}
}
function normalizeRegistryUrl(url) {
return url.endsWith("/") ? url.substring(0, url.length - 1) : url;
}
function highlightDiff(a, b, added) {
const aParts = a.split(/\./);
const bParts = b.split(/\./);