fix(semantics): recognize Node builtin default namespaces (#769)

* fix(semantics): recognize Node builtin default namespaces

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

* style(semantics): keep Babel imports before local helpers

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

---------

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-07 10:25:59 +08:00
committed by GitHub
parent 630bdafcac
commit 24a0bf9a61
8 changed files with 118 additions and 5 deletions
@@ -55,3 +55,10 @@ export const semanticPrimitiveKey = (
value: JavaScriptSemanticPrimitive,
): string =>
`${value === null ? "null" : typeof value}:${JSON.stringify(value)}`;
/** Match namespace paths only after the caller has identified a Node built-in. */
export const semanticBuiltinNamespacePath = (
importedPath: readonly string[],
): boolean =>
importedPath.length === 0 ||
(importedPath.length === 1 && importedPath[0] === "default");