Skip to content

Commit

Permalink
Fixes flow linting
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Sep 27, 2019
1 parent b29af01 commit 431a9e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {registries, registryNames} from './registries/index.js';
import {NoopReporter} from './reporters/index.js';
import map from './util/map.js';

const crypto = require('crypto');
const detectIndent = require('detect-indent');
const invariant = require('invariant');
const path = require('path');
Expand Down Expand Up @@ -508,7 +509,7 @@ export default class Config {
slug = `unknown-${slug}`;
}

const {hash} = pkg.remote;
const {hash, integrity} = pkg.remote;

if (pkg.version) {
slug += `-${pkg.version}`;
Expand All @@ -520,6 +521,10 @@ export default class Config {
slug += `-${hash}`;
}

if (integrity != null) {
slug += `-${crypto.createHash('sha1').update(integrity).digest('hex')}`;
}

return slug;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lockfile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default class Lockfile {
reporter.info(reporter.lang('noLockfileFound'));
}

if (lockfile.__metadata) {
if (lockfile && lockfile.__metadata) {
const lockfilev2 = lockfile;
lockfile = {};
}
Expand Down

0 comments on commit 431a9e9

Please sign in to comment.