summaryrefslogtreecommitdiff
path: root/lib/internal/modules/cjs/loader.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/modules/cjs/loader.js')
-rw-r--r--lib/internal/modules/cjs/loader.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 671006f9a9..0b98fb9d4f 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -22,6 +22,7 @@
'use strict';
const {
+ ArrayIsArray,
JSONParse,
ObjectCreate,
ObjectDefineProperty,
@@ -464,7 +465,7 @@ function trySelf(paths, exts, isMain, trailingSlash, request) {
function isConditionalDotExportSugar(exports, basePath) {
if (typeof exports === 'string')
return true;
- if (Array.isArray(exports))
+ if (ArrayIsArray(exports))
return true;
if (typeof exports !== 'object')
return false;
@@ -572,9 +573,9 @@ function resolveExportsTarget(pkgPath, target, subpath, basePath, mappingKey) {
}
}
}
- } else if (Array.isArray(target)) {
+ } else if (ArrayIsArray(target)) {
for (const targetValue of target) {
- if (Array.isArray(targetValue)) continue;
+ if (ArrayIsArray(targetValue)) continue;
try {
return resolveExportsTarget(pkgPath, targetValue, subpath, basePath,
mappingKey);
@@ -967,7 +968,7 @@ Module._resolveFilename = function(request, parent, isMain, options) {
let paths;
if (typeof options === 'object' && options !== null) {
- if (Array.isArray(options.paths)) {
+ if (ArrayIsArray(options.paths)) {
const isRelative = request.startsWith('./') ||
request.startsWith('../') ||
((isWindows && request.startsWith('.\\')) ||
@@ -1330,7 +1331,7 @@ Module._initPaths = function() {
};
Module._preloadModules = function(requests) {
- if (!Array.isArray(requests))
+ if (!ArrayIsArray(requests))
return;
// Preloaded modules have a dummy parent module which is deemed to exist