Skip to content

Commit 2dcfe92

Browse files
committed
tweaked
1 parent 8688728 commit 2dcfe92

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@ export function isNodeApiModule(modulePath: string): boolean {
5555
// Then check if it's readable (behavior differs by platform)
5656
if (process.platform === 'win32') {
5757
// On Windows, we need to try to open the file to check read permissions
58-
try {
59-
const fd = fs.openSync(filePath, 'r');
60-
fs.closeSync(fd);
61-
return true;
62-
} catch (e) {
63-
throw new Error(`Found an unreadable module ${fileName}: ${e}`);
64-
}
58+
const fd = fs.openSync(filePath, 'r');
59+
fs.closeSync(fd);
60+
return true;
6561
} else {
6662
// On Unix-like systems, we can use R_OK to check read permissions
6763
fs.accessSync(filePath, fs.constants.R_OK);

0 commit comments

Comments
 (0)