Skip to content

Commit c1c61d9

Browse files
committed
fix: patch lodash using @snyk/lodash
- Also: had to loosen TS strictness due to missing type definitions for forked lib - Using @snyk/graphlib 2.1.9-patch - Dropped unused lodash and graphlib @types dev deps
1 parent 9b45ff1 commit c1c61d9

11 files changed

+16
-17
lines changed

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
"url": "https://github.com/snyk/dep-graph/issues"
3131
},
3232
"devDependencies": {
33-
"@types/graphlib": "^2.1.4",
3433
"@types/jest": "^24",
35-
"@types/lodash": "^4",
3634
"@types/node": "^8",
3735
"@types/object-hash": "^1.2.0",
3836
"@types/semver": "^5",
@@ -43,8 +41,8 @@
4341
"typescript": "^3.7.2"
4442
},
4543
"dependencies": {
46-
"graphlib": "^2.1.5",
47-
"lodash": "^4.17.15",
44+
"@snyk/graphlib": "2.1.9-patch",
45+
"@snyk/lodash": "4.17.15-patch",
4846
"object-hash": "^1.3.1",
4947
"prettier": "^1.19.1",
5048
"semver": "^6.0.0",

src/core/builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as graphlib from 'graphlib';
1+
import * as graphlib from '@snyk/graphlib';
22
import * as types from './types';
33
import { DepGraphImpl } from './dep-graph';
44

src/core/create-from-json.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as semver from 'semver';
3-
import * as graphlib from 'graphlib';
3+
import * as graphlib from '@snyk/graphlib';
44
import * as types from './types';
55

66
import { DepGraph, DepGraphData, GraphNode } from './types';

src/core/dep-graph.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as _ from 'lodash';
2-
import * as graphlib from 'graphlib';
1+
import * as _ from '@snyk/lodash';
2+
import * as graphlib from '@snyk/graphlib';
33
import * as types from './types';
44
import { createFromJSON } from './create-from-json';
55

src/core/validate-graph.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as _ from 'lodash';
2-
import * as graphlib from 'graphlib';
1+
import * as _ from '@snyk/lodash';
2+
import * as graphlib from '@snyk/graphlib';
33
import { ValidationError } from './errors';
44

55
function assert(condition: boolean, msg: string) {

src/legacy/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as crypto from 'crypto';
33
import * as types from '../core/types';
44
import { DepGraphBuilder } from '../core/builder';
@@ -83,7 +83,7 @@ async function buildGraph(
8383
hashId: string,
8484
) => `${name}@${version || ''}|${hashId}`;
8585

86-
const depNodesIds = [];
86+
const depNodesIds: string[] = [];
8787

8888
const hash = crypto.createHash('sha1');
8989
if (depTree.versionProvenance) {

test/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as fs from 'fs';
33
import * as path from 'path';
44
import { PkgInfo } from '../src';

test/legacy/from-dep-tree.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as depGraphLib from '../../src';
33
import * as types from '../../src/core/types';
44
import * as helpers from '../helpers';

test/legacy/to-dep-tree-prune.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as depGraphLib from '../../src';
33
import * as helpers from '../helpers';
44

test/legacy/to-dep-tree.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as _ from 'lodash';
1+
import * as _ from '@snyk/lodash';
22
import * as depGraphLib from '../../src';
33
import * as helpers from '../helpers';
44

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"module": "commonjs",
1010
"sourceMap": true,
1111
"strict": true,
12+
"noImplicitAny": false,
1213
"declaration": true,
1314
"importHelpers": true
1415
},

0 commit comments

Comments
 (0)