@jsenv/module-resolution
Advanced tools
Comparing version 2.0.0 to 2.3.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); | ||
}; | ||
@@ -34,0 +35,0 @@ |
@@ -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); | ||
}; | ||
@@ -35,0 +36,0 @@ |
{ | ||
"name": "@jsenv/module-resolution", | ||
"version": "2.0.0", | ||
"version": "2.3.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
export 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) | ||
} |
// 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 | ||
export const isNativeBrowserModuleBareSpecifier = () => false | ||
const NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY = ["global"] | ||
export const isNativeBrowserModuleBareSpecifier = (specifier) => | ||
NATIVE_BROWSER_MODULE_SPECIFIER_ARRAY.includes(specifier) |
@@ -8,5 +8,10 @@ import Module from "module" | ||
export const isNativeNodeModuleBareSpecifier = | ||
"builtinModules" in Module | ||
? (bareSpecifier) => Module.builtinModules.includes(bareSpecifier) | ||
: (bareSpecifier) => bareSpecifier === "module" || repl._builtinLibs.includes(bareSpecifier) | ||
const NATIVE_NODE_MODULE_SPECIFIER_ARRAY = [ | ||
"global", | ||
...("builtinModules" in Module | ||
? Module.builtinModules | ||
: ["module", "util", ...repl._builtinLibs]), | ||
] | ||
export const isNativeNodeModuleBareSpecifier = (specifier) => | ||
NATIVE_NODE_MODULE_SPECIFIER_ARRAY.includes(specifier) |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
84732
964
0