Skip to content

Commit b5e6ecd

Browse files
committed
fix(proto): R_OK constant deprecation fallback logic
Fixes #117
1 parent fffbf62 commit b5e6ecd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/proto/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
} // without the ending '/', the final component is dropped
1515

1616
const loc = new URL(link || '', opts.baseUrl || processModule.cwd());
17-
fs.access(url.fileURLToPath(loc) || '', fs.hasOwnProperty('R_OK') ? fs.R_OK : fs.constants.R_OK, function (err) {
17+
fs.access(url.fileURLToPath(loc) || '', fs?.constants?.R_OK ?? fs?.R_OK, function (err) {
1818
callback(null, new LinkCheckResult(opts, link, !err ? 200 : 400, err));
1919
});
2020
}

0 commit comments

Comments
 (0)