Skip to content

Commit

Permalink
Simplify util
Browse files Browse the repository at this point in the history
Co-authored-by: Grigory <grigory.orlov.set@gmail.com>
  • Loading branch information
2 people authored and JounQin committed Jul 14, 2024
1 parent 1887cf1 commit b9dd135
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ const digestHashObject = (value: object | null | undefined) =>
* versions of Node.js, we can use module.isBuiltin instead of this function.
*/
function isBuiltin(moduleName: string) {
const moduleNameWithoutPrefix = moduleName.startsWith('node:')
? moduleName.slice(5)
: moduleName;

return builtinModules.includes(moduleNameWithoutPrefix);
return builtinModules.includes(moduleName.replace(/^node:/, ''));
}

/**
Expand Down

0 comments on commit b9dd135

Please sign in to comment.