Skip to content
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@nodesecure/documentation-ui": "^1.3.0",
"@nodesecure/flags": "^3.0.3",
"@nodesecure/i18n": "^4.0.1",
"@nodesecure/js-x-ray": "^8.2.0",
"@nodesecure/licenses-conformance": "^2.1.0",
"@nodesecure/npm-registry-sdk": "^3.0.0",
"@nodesecure/ossf-scorecard-sdk": "^3.2.1",
Expand Down
8 changes: 7 additions & 1 deletion src/http-server/config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// Import Third-party Dependencies
import { warnings } from "@nodesecure/js-x-ray";

// Import Internal Dependencies
import { appCache } from "../cache.js";
import { logger } from "../logger.js";

const experimentalWarnings = Object.entries(warnings)
.flatMap(([warning, { experimental }]) => (experimental ? [warning] : []));

// CONSTANTS
const kDefaultConfig = {
defaultPackageMenu: "info",
ignore: { flags: [], warnings: [] }
ignore: { flags: [], warnings: experimentalWarnings }
};

export async function get() {
Expand Down
5 changes: 4 additions & 1 deletion test/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import assert from "node:assert";

// Import Third-party Dependencies
import cacache from "cacache";
import { warnings } from "@nodesecure/js-x-ray";

// Import Internal Dependencies
import { get, set } from "../src/http-server/config.js";
Expand All @@ -29,7 +30,9 @@ describe("config", { concurrency: 1 }, () => {

assert.deepStrictEqual(value, {
defaultPackageMenu: "info",
ignore: { flags: [], warnings: [] }
ignore: { flags: [], warnings: Object.entries(warnings)
.filter(([_, { experimental }]) => experimental)
.map(([warning]) => warning) }
});
});

Expand Down