Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsenv/import-map

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/import-map - npm Package Compare versions

Comparing version 6.2.0 to 6.3.0

21

dist/commonjs/main.js

@@ -120,4 +120,10 @@ 'use strict';

const baseOrigin = hrefToOrigin(baseUrl);
const basePathname = hrefToPathname(baseUrl); // pathname relative inside
const basePathname = hrefToPathname(baseUrl);
if (specifier === ".") {
const baseDirname = pathnameToDirname(basePathname);
return `${baseOrigin}${baseDirname}/`;
} // pathname relative inside
if (specifier.slice(0, 2) === "./") {

@@ -135,9 +141,8 @@ const baseDirname = pathnameToDirname(basePathname);

while (unresolvedPathname.slice(0, 3) === "../") {
// when there is no folder left to resolved
unresolvedPathname = unresolvedPathname.slice(3); // when there is no folder left to resolved
// we just ignore '../'
if (importerFolders.length) {
importerFolders.pop();
}
unresolvedPathname = unresolvedPathname.slice(3);
}

@@ -569,2 +574,10 @@

}) => {
if (hrefToPathname(url) === "/") {
return url;
}
if (url.endsWith("/")) {
return url;
}
if (typeof defaultExtension === "string") {

@@ -571,0 +584,0 @@ const extension = pathnameToExtension(url);

2

package.json
{
"name": "@jsenv/import-map",
"description": "Helpers to implement importMap",
"version": "6.2.0",
"version": "6.3.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": {

@@ -21,2 +21,10 @@ // directly target the files because this code

const applyDefaultExtension = ({ url, importer, defaultExtension }) => {
if (hrefToPathname(url) === "/") {
return url
}
if (url.endsWith("/")) {
return url
}
if (typeof defaultExtension === "string") {

@@ -23,0 +31,0 @@ const extension = pathnameToExtension(url)

@@ -40,2 +40,7 @@ // could be useful: https://url.spec.whatwg.org/#url-miscellaneous

if (specifier === ".") {
const baseDirname = pathnameToDirname(basePathname)
return `${baseOrigin}${baseDirname}/`
}
// pathname relative inside

@@ -54,2 +59,3 @@ if (specifier.slice(0, 2) === "./") {

while (unresolvedPathname.slice(0, 3) === "../") {
unresolvedPathname = unresolvedPathname.slice(3)
// when there is no folder left to resolved

@@ -60,3 +66,2 @@ // we just ignore '../'

}
unresolvedPathname = unresolvedPathname.slice(3)
}

@@ -63,0 +68,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc