Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit 2655711

Browse files
committed
fix(checkPkgMap): Fix lock file and map file validation check
1 parent 56a15f5 commit 2655711

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const path = require('path')
99
const util = require('util')
1010
const yargs = require('yargs')
1111

12-
const readFileAsync = util.promisify(fs.readFile)
13-
1412
if (require.main === module) {
1513
main()
1614
}
@@ -36,8 +34,8 @@ function main () {
3634
function checkPkgMap () {
3735
try {
3836
const base = process.cwd()
39-
const lock = JSON.parse(stripBOM(readFileAsync(path.join(base, 'package-lock.json'), 'utf8')))
40-
const map = JSON.parse(stripBOM(readFileAsync(path.join(base, 'node_modules', '.package-map.json'), 'utf8')))
37+
const lock = JSON.parse(stripBOM(fs.readFileSync(path.join(base, 'package-lock.json'), 'utf8')))
38+
const map = JSON.parse(stripBOM(fs.readFileSync(path.join(base, 'node_modules', '.package-map.json'), 'utf8')))
4139
require('ssri').checkData(
4240
JSON.stringify(lock), map.lockfile_integrity, {error: true}
4341
)

0 commit comments

Comments
 (0)