Skip to content

Commit

Permalink
fix: patch lodash using @snyk/lodash
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
gitphill committed Apr 29, 2020
1 parent 9b45ff1 commit c1c61d9
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 17 deletions.
6 changes: 2 additions & 4 deletions package.json
Expand Up @@ -30,9 +30,7 @@
"url": "https://github.com/snyk/dep-graph/issues"
},
"devDependencies": {
"@types/graphlib": "^2.1.4",
"@types/jest": "^24",
"@types/lodash": "^4",
"@types/node": "^8",
"@types/object-hash": "^1.2.0",
"@types/semver": "^5",
Expand All @@ -43,8 +41,8 @@
"typescript": "^3.7.2"
},
"dependencies": {
"graphlib": "^2.1.5",
"lodash": "^4.17.15",
"@snyk/graphlib": "2.1.9-patch",
"@snyk/lodash": "4.17.15-patch",
"object-hash": "^1.3.1",
"prettier": "^1.19.1",
"semver": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/builder.ts
@@ -1,4 +1,4 @@
import * as graphlib from 'graphlib';
import * as graphlib from '@snyk/graphlib';
import * as types from './types';
import { DepGraphImpl } from './dep-graph';

Expand Down
4 changes: 2 additions & 2 deletions src/core/create-from-json.ts
@@ -1,6 +1,6 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as semver from 'semver';
import * as graphlib from 'graphlib';
import * as graphlib from '@snyk/graphlib';
import * as types from './types';

import { DepGraph, DepGraphData, GraphNode } from './types';
Expand Down
4 changes: 2 additions & 2 deletions src/core/dep-graph.ts
@@ -1,5 +1,5 @@
import * as _ from 'lodash';
import * as graphlib from 'graphlib';
import * as _ from '@snyk/lodash';
import * as graphlib from '@snyk/graphlib';
import * as types from './types';
import { createFromJSON } from './create-from-json';

Expand Down
4 changes: 2 additions & 2 deletions src/core/validate-graph.ts
@@ -1,5 +1,5 @@
import * as _ from 'lodash';
import * as graphlib from 'graphlib';
import * as _ from '@snyk/lodash';
import * as graphlib from '@snyk/graphlib';
import { ValidationError } from './errors';

function assert(condition: boolean, msg: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/index.ts
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as crypto from 'crypto';
import * as types from '../core/types';
import { DepGraphBuilder } from '../core/builder';
Expand Down Expand Up @@ -83,7 +83,7 @@ async function buildGraph(
hashId: string,
) => `${name}@${version || ''}|${hashId}`;

const depNodesIds = [];
const depNodesIds: string[] = [];

const hash = crypto.createHash('sha1');
if (depTree.versionProvenance) {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.ts
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as fs from 'fs';
import * as path from 'path';
import { PkgInfo } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion test/legacy/from-dep-tree.test.ts
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as depGraphLib from '../../src';
import * as types from '../../src/core/types';
import * as helpers from '../helpers';
Expand Down
2 changes: 1 addition & 1 deletion test/legacy/to-dep-tree-prune.test.ts
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as depGraphLib from '../../src';
import * as helpers from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion test/legacy/to-dep-tree.test.ts
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _ from '@snyk/lodash';
import * as depGraphLib from '../../src';
import * as helpers from '../helpers';

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -9,6 +9,7 @@
"module": "commonjs",
"sourceMap": true,
"strict": true,
"noImplicitAny": false,
"declaration": true,
"importHelpers": true
},
Expand Down

0 comments on commit c1c61d9

Please sign in to comment.