Skip to content

Commit

Permalink
Merge pull request #22 from snyk/fix/update-typescript-library
Browse files Browse the repository at this point in the history
chore: updated typescript template
  • Loading branch information
Kirill89 committed Oct 4, 2018
2 parents b44f6e2 + f4e9c34 commit 4254065
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3,844 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
dist
.DS_Store
*.log
package-lock.json
5 changes: 3 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'source-map-support/register';
import * as fs from 'fs';
import * as path from 'path';
import * as _ from 'lodash';
import {LockfileParser, Lockfile, ManifestFile, PkgTree,
DepType, parseManifestFile, LockfileType} from './parsers';
import {PackageLockParser} from './parsers/package-lock-parser';
Expand Down Expand Up @@ -60,9 +61,9 @@ async function buildDepTreeFromFiles(
}

let lockFileType: LockfileType;
if (lockFilePath.endsWith('package-lock.json')) {
if (_.endsWith(lockFilePath, 'package-lock.json')) {
lockFileType = LockfileType.npm;
} else if (lockFilePath.endsWith('yarn.lock')) {
} else if (_.endsWith(lockFilePath, 'yarn.lock')) {
lockFileType = LockfileType.yarn;
} else {
throw new Error(`Unknown lockfile ${lockFilePath}.
Expand Down
Loading

0 comments on commit 4254065

Please sign in to comment.