stricter hash parsing from git url

This commit is contained in:
silverwind 2020-04-20 11:03:01 +02:00
parent ea78984908
commit 8184f6c806
Signed by: silverwind
GPG Key ID: 2E62B41C93869443
2 changed files with 4 additions and 3 deletions

@ -8,7 +8,8 @@
"jpeg-buffer-orientation": "0.0.0",
"styled-components": "2.5.0-1",
"@babel/preset-env": "7.0.0",
"updates": "https://github.com/silverwind/updates/tarball/6941e05"
"updates": "https://github.com/silverwind/updates/tarball/6941e05",
"ipaddr.js": "https://github.com/silverwind/ipaddr.js/tarball/ipv6_cidrs_take2"
},
"devDependencies": {
"updates": "file:."

@ -25,8 +25,8 @@ const cwd = cwdFn();
// regexes for url dependencies. does only github and only hash or exact semver
// https://regex101.com/r/gCZzfK/2
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 partsRe = /^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i;
const hashRe = /^[0-9a-f]{7,}$/i;
const memoize = fn => {
const cache = {};