import-meta-resolve
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -13,4 +13,4 @@ /// <reference types="node" /> | ||
* @param {URL} base | ||
* @param {Set<string>} conditions | ||
* @param {boolean} preserveSymlinks | ||
* @param {Set<string>} [conditions] | ||
* @param {boolean} [preserveSymlinks] | ||
* @returns {URL} | ||
@@ -21,4 +21,4 @@ */ | ||
base: URL, | ||
conditions: Set<string>, | ||
preserveSymlinks: boolean | ||
conditions?: Set<string> | undefined, | ||
preserveSymlinks?: boolean | undefined | ||
): URL | ||
@@ -25,0 +25,0 @@ /** |
@@ -320,3 +320,3 @@ // Manually “tree shaken” from: | ||
* @param {URL} base | ||
* @param {boolean} preserveSymlinks | ||
* @param {boolean} [preserveSymlinks] | ||
* @returns {URL} | ||
@@ -1102,4 +1102,4 @@ */ | ||
* @param {URL} base | ||
* @param {Set<string>} conditions | ||
* @param {boolean} preserveSymlinks | ||
* @param {Set<string>} [conditions] | ||
* @param {boolean} [preserveSymlinks] | ||
* @returns {URL} | ||
@@ -1106,0 +1106,0 @@ */ |
{ | ||
"name": "import-meta-resolve", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Resolve things like Node.js — ponyfill for `import.meta.resolve`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -51,25 +51,21 @@ # import-meta-resolve | ||
main() | ||
// A file: | ||
console.log(await resolve('./index.js', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/index.js | ||
async function main() { | ||
// A file: | ||
console.log(await resolve('./index.js', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/index.js | ||
// A CJS package: | ||
console.log(await resolve('builtins', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/builtins/index.js | ||
// A CJS package: | ||
console.log(await resolve('builtins', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/builtins/index.js | ||
// A scoped CJS package: | ||
console.log(await resolve('@eslint/eslintrc', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@eslint/eslintrc/lib/index.js | ||
// A scoped CJS package: | ||
console.log(await resolve('@eslint/eslintrc', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@eslint/eslintrc/lib/index.js | ||
// A package with an export map: | ||
console.log(await resolve('tape/lib/test', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/tape/lib/test.js | ||
// A package with an export map: | ||
console.log(await resolve('tape/lib/test', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/tape/lib/test.js | ||
// A node builtin: | ||
console.log(await resolve('fs', import.meta.url)) | ||
//=> node:fs | ||
} | ||
// A node builtin: | ||
console.log(await resolve('fs', import.meta.url)) | ||
//=> node:fs | ||
``` | ||
@@ -76,0 +72,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
64228
214