From 88939f9da12d9c4ce478336bcc88b3fdd321faf4 Mon Sep 17 00:00:00 2001 From: fraxken Date: Thu, 25 Sep 2025 16:25:05 +0200 Subject: [PATCH] refactor(documentation-ui): use @nodesecure/js-x-ray/warnings to build menu list --- workspaces/documentation-ui/index.js | 17 ++++------------- workspaces/documentation-ui/package.json | 1 + 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/workspaces/documentation-ui/index.js b/workspaces/documentation-ui/index.js index 9607e5cc..e8a035b5 100644 --- a/workspaces/documentation-ui/index.js +++ b/workspaces/documentation-ui/index.js @@ -2,6 +2,7 @@ // Import Third-party Dependencies import { getManifest } from "@nodesecure/flags/web"; +import { warnings } from "@nodesecure/js-x-ray/warnings"; // Import Internal Dependencies import * as utils from "./src/utils.js"; @@ -11,19 +12,9 @@ import { Navigation } from "./src/components/navigation.class.js"; import { fetchAndRenderByMenu } from "./src/fetch.js"; // CONSTANTS -const kSASTWarnings = [ - "parsing-error", - "unsafe-import", - "unsafe-regex", - "unsafe-stmt", - "shady-link", - "encoded-literal", - "short-identifiers", - "suspicious-literal", - "suspicious-file", - "obfuscated-code", - "weak-crypto" -].map((name) => ({ name })); +const kSASTWarnings = Object + .keys(warnings) + .map((name) => ({ name })); const kWikiMenus = { flags: { diff --git a/workspaces/documentation-ui/package.json b/workspaces/documentation-ui/package.json index fc63600f..76db7f8f 100644 --- a/workspaces/documentation-ui/package.json +++ b/workspaces/documentation-ui/package.json @@ -26,6 +26,7 @@ "license": "MIT", "dependencies": { "@nodesecure/flags": "^2.4.0", + "@nodesecure/js-x-ray": "^9.2.0", "highlight.js": "^11.10.0", "markdown-it": "^14.1.0" }