@jsenv/importmap
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@jsenv/importmap", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Helpers to implement importmaps", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -11,3 +11,3 @@ # importmap | ||
`@jsenv/importmap` can be used to implement the behaviour of importmap as described in the [WICG specification](https://github.com/WICG/import-maps). It is written using ES modules and compatible with browsers and Node.js. Amongst other things, this repository is used to provide [importmap in ESLint](https://github.com/jsenv/jsenv-importmap-eslint-resolver). | ||
`@jsenv/importmap` can be used to implement the behaviour of importmap as described in the [WICG specification](https://github.com/WICG/import-maps). It is written using ES modules and compatible with browsers and Node.js. Amongst other things, this repository is used to provide [importmap in ESLint](https://github.com/jsenv/importmap-eslint-resolver#presentation). | ||
@@ -22,3 +22,3 @@ # Installation | ||
`composeTwoImportMaps` takes two `importMap` and return a single `importMap` being the composition of the two. | ||
_composeTwoImportMaps_ takes two _importMap_ and return a single _importMap_ being the composition of the two. | ||
@@ -52,7 +52,5 @@ ```js | ||
— source code at [src/composeTwoImportMaps.js](./src/composeTwoImportMaps.js). | ||
# normalizeImportMap | ||
`normalizeImportMap` returns an `importMap` resolved against an `url` and sorted. | ||
_normalizeImportMap_ returns an _importMap_ resolved against an _url_ and sorted. | ||
@@ -84,7 +82,5 @@ ```js | ||
— source code at [src/normalizeImportMap.js](./src/normalizeImportMap.js). | ||
# resolveImport | ||
`resolveImport` returns an import `url` applying an `importMap` to `specifier` and `importer`. The provided `importMap` must be resolved and sorted to work as expected. You can use [normalizeImportMap](#normalizeimportmap) to do that. | ||
_resolveImport_ returns an import _url_ applying an _importMap_ to _specifier_ and _importer_. The provided _importMap_ must be resolved and sorted to work as expected. You can use [normalizeImportMap](#normalizeimportmap) to do that. | ||
@@ -111,7 +107,5 @@ ```js | ||
— source code at [src/resolveImport.js](./src/resolveImport.js). | ||
# moveImportMap | ||
`moveImportMap` receives `importMap`, `fromUrl`, `toUrl` and return an importmap where all relative urls and specifiers becomes relative to `toUrl` instead of `fromUrl`. | ||
_moveImportMap_ receives _importMap_, _fromUrl_, _toUrl_ and return an importmap where all relative urls and specifiers becomes relative to _toUrl_ instead of _fromUrl_. | ||
@@ -142,3 +136,1 @@ This function exists in case you need to move an importmap file somewhere else in the filesystem. This is not a common use case but might happen. | ||
``` | ||
— source code at [src/moveImportMap.js](./src/moveImportMap.js). |
@@ -7,3 +7,3 @@ // https://github.com/browserify/resolve/blob/a09a2e7f16273970be4639313c83b913daea15d7/lib/core.json#L1 | ||
export const isSpecifierForNodeCoreModule = (specifier) => { | ||
return NODE_CORE_MODULE_SPECIFIERS.includes(specifier) | ||
return specifier.startsWith("node:") || NODE_CORE_MODULE_SPECIFIERS.includes(specifier) | ||
} | ||
@@ -10,0 +10,0 @@ |
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
193740
131