-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konstantin Yegupov
committed
Apr 5, 2019
1 parent
689cf1b
commit d12167d
Showing
6 changed files
with
175 additions
and
82 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
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,54 @@ | ||
import * as depGraphLib from '@snyk/dep-graph'; | ||
|
||
// TODO(kyegupov): use a shared repository snyk-cli-interface | ||
|
||
export interface PluginMetadata { | ||
name: string; | ||
packageFormatVersion?: string; | ||
packageManager: string; | ||
imageLayers?: any; | ||
targetFile?: string; // this is wrong (because Shaun said it) | ||
runtime?: any; | ||
dockerImageId: any; | ||
} | ||
|
||
export interface DepDict { | ||
[name: string]: DepTree; | ||
} | ||
|
||
export interface DepTree { | ||
name: string; | ||
version: string; | ||
dependencies?: DepDict; | ||
packageFormatVersion?: string; | ||
docker?: any; | ||
files?: any; | ||
targetFile?: string; | ||
} | ||
|
||
export interface DepRoot { | ||
depTree: DepTree; // to be soon replaced with depGraph | ||
targetFile?: string; | ||
} | ||
|
||
export interface Package { | ||
plugin: PluginMetadata; | ||
depRoots?: DepRoot[]; // currently only returned by gradle | ||
package?: DepTree; | ||
} | ||
|
||
// Legacy result type. Will be deprecated soon. | ||
export interface SingleDepRootResult { | ||
plugin: PluginMetadata; | ||
package: DepTree; | ||
} | ||
|
||
export interface MultiDepRootsResult { | ||
plugin: PluginMetadata; | ||
depRoots: DepRoot[]; | ||
} | ||
|
||
// https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards | ||
export function isMultiResult(pet: SingleDepRootResult | MultiDepRootsResult): pet is MultiDepRootsResult { | ||
return !!(pet as MultiDepRootsResult).depRoots; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ceptance/workspaces/npm-package-policy/node_modules/marked/.snyk-npm-marked-20170112.flag
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.