Skip to content

Commit

Permalink
fix: use String
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth authored Jun 15, 2022
1 parent 57f5686 commit 55916da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ added: v18.4.0
```mjs
import { isBuiltIn } from 'node:module';
isBuiltIn('node:fs'); // true
isBuiltIn('fs'); // true
isBuiltIn('fs'); // true
isBuiltIn('wss'); // false
```
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ Module.syncBuiltinESMExports = function syncBuiltinESMExports() {
};

Module.isBuiltIn = function isBuiltIn(moduleName) {
moduleName = StringPrototypeReplace(moduleName, /^node:/, '');
moduleName = StringPrototypeReplace(String(moduleName), /^node:/, '');
return ArrayPrototypeIncludes(Module.builtinModules, moduleName);
};

Expand Down

0 comments on commit 55916da

Please sign in to comment.