@jsenv/eslint-import-resolver
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -30,4 +30,5 @@ 'use strict'; | ||
const hrefToScheme = href => { | ||
const dotIndex = href.indexOf(":"); | ||
return href.slice(0, dotIndex); | ||
const colonIndex = href.indexOf(":"); | ||
if (colonIndex === -1) return ""; | ||
return href.slice(0, colonIndex); | ||
}; | ||
@@ -364,5 +365,10 @@ | ||
const isNativeNodeModuleBareSpecifier = "builtinModules" in namespace ? bareSpecifier => namespace.builtinModules.includes(bareSpecifier) : bareSpecifier => bareSpecifier === "module" || namespace$1._builtinLibs.includes(bareSpecifier); | ||
const NATIVE_NODE_MODULE_SPECIFIER_ARRAY = ["global", ...("builtinModules" in namespace ? namespace.builtinModules : ["module", "util", ...namespace$1._builtinLibs])]; | ||
const isNativeNodeModuleBareSpecifier = specifier => NATIVE_NODE_MODULE_SPECIFIER_ARRAY.includes(specifier); | ||
// when browser will start to provide native module | ||
// we could statr to return true on some specifier | ||
// it will allow eslint-plugin-import to consider these plugins as found | ||
const NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY = ["global"]; | ||
const isNativeBrowserModuleBareSpecifier = specifier => NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY.includes(specifier); | ||
@@ -508,2 +514,10 @@ const namespace$2 = require("fs"); | ||
if (isNativeBrowserModuleBareSpecifier(source)) { | ||
log(`-> native browser module`); | ||
return { | ||
found: true, | ||
path: null | ||
}; | ||
} | ||
const resolvedImport = resolveImport({ | ||
@@ -510,0 +524,0 @@ importer: importerHref, |
@@ -31,4 +31,5 @@ 'use strict'; | ||
var hrefToScheme = function hrefToScheme(href) { | ||
var dotIndex = href.indexOf(":"); | ||
return href.slice(0, dotIndex); | ||
var colonIndex = href.indexOf(":"); | ||
if (colonIndex === -1) return ""; | ||
return href.slice(0, colonIndex); | ||
}; | ||
@@ -207,2 +208,22 @@ | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
} | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
} | ||
var remapResolvedImport = function remapResolvedImport(_ref) { | ||
@@ -366,9 +387,14 @@ var importMap = _ref.importMap, | ||
var isNativeNodeModuleBareSpecifier = "builtinModules" in namespace ? function (bareSpecifier) { | ||
return namespace.builtinModules.includes(bareSpecifier); | ||
} : function (bareSpecifier) { | ||
return bareSpecifier === "module" || namespace$1._builtinLibs.includes(bareSpecifier); | ||
var NATIVE_NODE_MODULE_SPECIFIER_ARRAY = ["global"].concat(_toConsumableArray("builtinModules" in namespace ? namespace.builtinModules : ["module", "util"].concat(_toConsumableArray(namespace$1._builtinLibs)))); | ||
var isNativeNodeModuleBareSpecifier = function isNativeNodeModuleBareSpecifier(specifier) { | ||
return NATIVE_NODE_MODULE_SPECIFIER_ARRAY.includes(specifier); | ||
}; | ||
// when browser will start to provide native module | ||
// we could statr to return true on some specifier | ||
// it will allow eslint-plugin-import to consider these plugins as found | ||
var NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY = ["global"]; | ||
var isNativeBrowserModuleBareSpecifier = function isNativeBrowserModuleBareSpecifier(specifier) { | ||
return NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY.includes(specifier); | ||
}; | ||
@@ -515,2 +541,10 @@ var namespace$2 = require("fs"); | ||
if (isNativeBrowserModuleBareSpecifier(source)) { | ||
log("-> native browser module"); | ||
return { | ||
found: true, | ||
path: null | ||
}; | ||
} | ||
var resolvedImport = resolveImport({ | ||
@@ -517,0 +551,0 @@ importer: importerHref, |
{ | ||
"name": "@jsenv/eslint-import-resolver", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"license": "MIT", | ||
@@ -20,3 +20,3 @@ "repository": { | ||
"dependencies": { | ||
"@jsenv/module-resolution": "1.0.0" | ||
"@jsenv/module-resolution": "2.3.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137687
1288
+ Added@jsenv/module-resolution@2.3.0(transitive)
- Removed@jsenv/module-resolution@1.0.0(transitive)