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

Commit

Permalink
fix(checkPkgMap): Fix lock file and map file validation check
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed Sep 14, 2018
1 parent 56a15f5 commit 2655711
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const path = require('path')
const util = require('util')
const yargs = require('yargs')

const readFileAsync = util.promisify(fs.readFile)

if (require.main === module) {
main()
}
Expand All @@ -36,8 +34,8 @@ function main () {
function checkPkgMap () {
try {
const base = process.cwd()
const lock = JSON.parse(stripBOM(readFileAsync(path.join(base, 'package-lock.json'), 'utf8')))
const map = JSON.parse(stripBOM(readFileAsync(path.join(base, 'node_modules', '.package-map.json'), 'utf8')))
const lock = JSON.parse(stripBOM(fs.readFileSync(path.join(base, 'package-lock.json'), 'utf8')))
const map = JSON.parse(stripBOM(fs.readFileSync(path.join(base, 'node_modules', '.package-map.json'), 'utf8')))
require('ssri').checkData(
JSON.stringify(lock), map.lockfile_integrity, {error: true}
)
Expand Down

0 comments on commit 2655711

Please sign in to comment.