diff options
Diffstat (limited to 'std/node/module.ts')
-rw-r--r-- | std/node/module.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/std/node/module.ts b/std/node/module.ts index daa01d2b2..55c5f2d32 100644 --- a/std/node/module.ts +++ b/std/node/module.ts @@ -659,7 +659,9 @@ function readPackage(requestPath: string): PackageInfo | null { json = new TextDecoder().decode( Deno.readFileSync(path.toNamespacedPath(jsonPath)) ); - } catch {} + } catch { + // pass + } if (json === undefined) { packageJsonCache.set(jsonPath, null); @@ -839,7 +841,7 @@ function applyExports(basePath: string, expansion: string): string { } if (typeof pkgExports === "object") { - if (pkgExports.hasOwnProperty(mappingKey)) { + if (Object.prototype.hasOwnProperty.call(pkgExports, mappingKey)) { const mapping = pkgExports[mappingKey]; return resolveExportsTarget( pathToFileURL(basePath + "/"), @@ -910,7 +912,6 @@ function resolveExports( return path.resolve(nmPath, request); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any function resolveExportsTarget( pkgPath: URL, // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -959,7 +960,7 @@ function resolveExportsTarget( } } else if (typeof target === "object" && target !== null) { // removed experimentalConditionalExports - if (target.hasOwnProperty("default")) { + if (Object.prototype.hasOwnProperty.call(target, "default")) { try { return resolveExportsTarget( pkgPath, @@ -1012,7 +1013,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy( }, getOwnPropertyDescriptor(target, prop): PropertyDescriptor | undefined { - if (target.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(target, prop)) { return Object.getOwnPropertyDescriptor(target, prop); } emitCircularRequireWarning(prop); @@ -1114,7 +1115,6 @@ interface RequireResolveFunction extends RequireResolve { } interface RequireFunction extends Require { - // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve: RequireResolveFunction; // eslint-disable-next-line @typescript-eslint/no-explicit-any extensions: { [key: string]: (module: Module, filename: string) => any }; |