From f097e9fefb8c0296f5db4c3787ffc086bdb9bffd Mon Sep 17 00:00:00 2001 From: Euan Robertson Date: Tue, 30 Apr 2024 10:54:06 +0100 Subject: [PATCH] fix: moved the known tools list out of function scope --- src/builder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builder.ts b/src/builder.ts index 70b1155..cbba557 100644 --- a/src/builder.ts +++ b/src/builder.ts @@ -5,6 +5,8 @@ import { getCorrespondingPackageFromModuleId } from "./helpers"; const require = createRequire(import.meta.url); +const knownTools = ["rollup-plugin-sbom", "vite", "rollup"]; + export function registerPackageUrlOnComponent( component: Models.Component | undefined, factory: Factories.FromNodePackageJson.PackageUrlFactory, @@ -29,8 +31,6 @@ export async function registerTools(bom: Models.Bom, builder: Builders.FromNodeP } } - const knownTools = ["rollup-plugin-sbom", "vite", "rollup"]; - for (const pkgName of knownTools) { await registerTool(pkgName); }