Skip to content

Commit ad9fb3b

Browse files
committed
fix win32 incompatibility
1 parent 4f008a4 commit ad9fb3b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/react-native-node-api-modules/src/node/path-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ export function findNodeApiModulePaths(
247247
return [];
248248
}
249249
const candidatePath = path.join(fromPath, suffix);
250+
// Normalize path separators for consistent pattern matching on all platforms
251+
const normalizedSuffix = suffix.split(path.sep).join('/');
252+
253+
if (excludePatterns.some((pattern) => pattern.test(normalizedSuffix))) {
254+
return [];
255+
}
256+
250257
return fs
251258
.readdirSync(candidatePath, { withFileTypes: true })
252259
.flatMap((file) => {

0 commit comments

Comments
 (0)