-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove special npm/yarn path in snyk-test
- Loading branch information
Konstantin Yegupov
committed
May 9, 2019
1 parent
8a1393a
commit 73e96aa
Showing
13 changed files
with
166 additions
and
544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as modulesParser from './npm-modules-parser'; | ||
import * as lockParser from './npm-lock-parser'; | ||
import * as types from '../types'; | ||
|
||
export async function inspect(root: string, targetFile: string, options: types.Options = {}): | ||
Promise<types.InspectResult> { | ||
const isLockFileBased = (targetFile.endsWith('package-lock.json') || targetFile.endsWith('yarn.lock')); | ||
|
||
const getLockFileDeps = isLockFileBased && !options.traverseNodeModules; | ||
return { | ||
plugin: { | ||
name: 'snyk-nodejs-lockfile-parser', | ||
runtime: process.version, | ||
}, | ||
package: getLockFileDeps ? | ||
await lockParser.parse(root, targetFile, options) : | ||
await modulesParser.parse(root, targetFile, options), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.