Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement @nodesecure/rc to highlight contacts #282

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 90 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions workspaces/scanner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@nodesecure/mama": "^1.0.0",
"@nodesecure/npm-registry-sdk": "^3.0.0",
"@nodesecure/npm-types": "^1.0.0",
"@nodesecure/rc": "^3.0.0",
"@nodesecure/tarball": "^1.0.0",
"@nodesecure/tree-walker": "^1.0.0",
"@nodesecure/vuln": "^1.7.0",
Expand Down
6 changes: 5 additions & 1 deletion workspaces/scanner/src/utils/warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from "node:path";

// Import Third-party Dependencies
import * as i18n from "@nodesecure/i18n";
import * as RC from "@nodesecure/rc";
import {
ContactExtractor,
type IlluminatedContact,
Expand Down Expand Up @@ -58,10 +59,13 @@ export async function getDependenciesWarnings(
};
}

// TODO: extract illuminated from RC
const memoizedConfig = RC.memoized();
const extractor = new ContactExtractor({
highlight: [
...highlightContacts,
...(memoizedConfig === null ?
[] : (memoizedConfig.scanner?.highlight?.contacts ?? [])
),
...kDefaultIlluminatedContacts
]
});
Expand Down