@npmcli/arborist
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -137,3 +137,3 @@ // a module that manages a shrinkwrap file (npm-shrinkwrap.json or | ||
// check to make sure that there are no packages newer than the hidden lockfile | ||
const assertNoNewer = async (path, data, lockTime, dir = path) => { | ||
const assertNoNewer = async (path, data, lockTime, dir = path, seen = null) => { | ||
const base = basename(dir) | ||
@@ -144,5 +144,5 @@ const isNM = dir !== path && base === 'node_modules' | ||
const rel = relpath(path, dir) | ||
if (dir !== path) { | ||
const dirTime = (await stat(dir)).mtime | ||
const rel = relpath(path, dir) | ||
if (dirTime > lockTime) | ||
@@ -152,3 +152,5 @@ throw 'out of date, updated: ' + rel | ||
throw 'missing from lockfile: ' + rel | ||
} | ||
seen.add(rel) | ||
} else | ||
seen = new Set([rel]) | ||
@@ -163,4 +165,13 @@ const parent = isParent ? dir : resolve(dir, 'node_modules') | ||
ents.filter(ent => ent.isDirectory() && !/^\./.test(ent.name)) | ||
.map(ent => assertNoNewer(path, data, lockTime, resolve(parent, ent.name))) | ||
)) | ||
.map(ent => assertNoNewer(path, data, lockTime, resolve(parent, ent.name), seen)) | ||
)).then(() => { | ||
if (dir !== path) | ||
return | ||
// assert that all the entries in the lockfile were seen | ||
for (const loc of new Set(Object.keys(data.packages))) { | ||
if (!seen.has(loc)) | ||
throw 'missing from node_modules: ' + loc | ||
} | ||
}) | ||
} | ||
@@ -167,0 +178,0 @@ |
{ | ||
"name": "@npmcli/arborist", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Manage node_modules trees", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252120
6128