Skip to content

Commit

Permalink
feat: use npm:lodash.isequal, no more @snyk/lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
FauxFaux committed May 24, 2020
1 parent 2844389 commit 826643f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@snyk/graphlib": "2.1.9-patch",
"@snyk/lodash": "4.17.15-patch",
"lodash.isequal": "^4.5.0",
"object-hash": "^2.0.3",
"semver": "^6.0.0",
"source-map-support": "^0.5.19",
Expand Down
6 changes: 3 additions & 3 deletions src/core/dep-graph.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _isEqual from 'lodash.isequal';
import * as graphlib from '@snyk/graphlib';
import * as types from './types';
import { createFromJSON } from './create-from-json';
Expand Down Expand Up @@ -255,15 +255,15 @@ class DepGraphImpl implements types.DepGraphInternal {
const pkgB = graphB.getNodePkg(nodeIdB);

// Compare PkgInfo (name and version).
if (!_.isEqual(pkgA, pkgB)) {
if (!_isEqual(pkgA, pkgB)) {
return false;
}

const infoA = graphA.getNode(nodeIdA);
const infoB = graphB.getNode(nodeIdB);

// Compare NodeInfo (VersionProvenance and labels).
if (!_.isEqual(infoA, infoB)) {
if (!_isEqual(infoA, infoB)) {
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _isEqual from 'lodash.isequal';
import * as fs from 'fs';
import * as path from 'path';
import { PkgInfo } from '../src';
Expand Down Expand Up @@ -35,8 +35,8 @@ export function depTreesEqual(a: any, b: any) {
}

if (
!_.isEqual(a.labels, b.labels) ||
!_.isEqual(a.versionProvenance, b.versionProvenance)
!_isEqual(a.labels, b.labels) ||
!_isEqual(a.versionProvenance, b.versionProvenance)
) {
return false;
}
Expand Down

0 comments on commit 826643f

Please sign in to comment.