Skip to content

Commit fcc5967

Browse files
committed
refactor(build): use normalizePath from lib in export validation
Replace manual path.sep.join('/') with #socketsecurity/lib normalizePath utility for better consistency.
1 parent bcc93c2 commit fcc5967

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/validate-dist-exports.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'node:url'
1111
import colors from 'yoctocolors-cjs'
1212

1313
import { isQuiet } from '#socketsecurity/lib/argv/flags'
14+
import { normalizePath } from '#socketsecurity/lib/paths'
1415
import { pluralize } from '#socketsecurity/lib/words'
1516

1617
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -44,7 +45,7 @@ function checkExport(filePath) {
4445
// used by public dist/* modules. We only validate public exports.
4546
const relativePath = path.relative(distDir, filePath)
4647
// Normalize path for cross-platform compatibility (Windows uses backslashes)
47-
const normalizedPath = relativePath.split(path.sep).join('/')
48+
const normalizedPath = normalizePath(relativePath)
4849
if (normalizedPath.startsWith('external/')) {
4950
return { path: filePath, ok: true, skipped: true }
5051
}

0 commit comments

Comments
 (0)