@vxrn/resolve
Advanced tools
Comparing version 1.1.338 to 1.1.339
@@ -0,5 +1,6 @@ | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
@@ -14,3 +15,10 @@ for (var name in all) | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, | ||
mod | ||
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var src_exports = {}; | ||
@@ -21,4 +29,10 @@ __export(src_exports, { | ||
module.exports = __toCommonJS(src_exports); | ||
var import_node_url = require("node:url"); | ||
const import_meta = {}, resolver = "resolve" in import_meta ? (path, from) => (0, import_node_url.fileURLToPath)(import_meta.resolve(path, from)) : "url" in import_meta ? (path, from) => new URL(path, import_meta.url).pathname : require.resolve, resolvePath = (path, from) => resolver(path, from); | ||
var import_node_module = __toESM(require("node:module"), 1), import_node_url = require("node:url"); | ||
const import_meta = {}, resolver = "resolve" in import_meta ? (path, from) => (0, import_node_url.fileURLToPath)(import_meta.resolve(path, from)) : "url" in import_meta ? (path, from) => new URL(path, import_meta.url).pathname : require.resolve, resolverV2 = (path, from) => import_node_module.default.createRequire(from).resolve(path, { paths: [from] }), resolvePath = (path, from) => { | ||
try { | ||
return resolver(path, from); | ||
} catch { | ||
return resolverV2(path, from); | ||
} | ||
}; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
@@ -15,3 +16,10 @@ for (var name in all) | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, | ||
mod | ||
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
var src_exports = {}; | ||
@@ -22,3 +30,3 @@ __export(src_exports, { | ||
module.exports = __toCommonJS(src_exports); | ||
var import_node_url = require("node:url"); | ||
var import_node_module = __toESM(require("node:module"), 1), import_node_url = require("node:url"); | ||
const import_meta = {}; | ||
@@ -29,4 +37,15 @@ var resolver = "resolve" in import_meta ? function(path, from) { | ||
return new URL(path, import_meta.url).pathname; | ||
} : require.resolve, resolvePath = function(path, from) { | ||
return resolver(path, from); | ||
} : require.resolve, resolverV2 = function(path, from) { | ||
var _$require = import_node_module.default.createRequire(from), importPath = _$require.resolve(path, { | ||
paths: [ | ||
from | ||
] | ||
}); | ||
return importPath; | ||
}, resolvePath = function(path, from) { | ||
try { | ||
return resolver(path, from); | ||
} catch { | ||
return resolverV2(path, from); | ||
} | ||
}; | ||
@@ -33,0 +52,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -0,3 +1,10 @@ | ||
import module from "node:module"; | ||
import { fileURLToPath } from "node:url"; | ||
const resolver = "resolve" in import.meta ? (path, from) => fileURLToPath(import.meta.resolve(path, from)) : "url" in import.meta ? (path, from) => new URL(path, import.meta.url).pathname : require.resolve, resolvePath = (path, from) => resolver(path, from); | ||
const resolver = "resolve" in import.meta ? (path, from) => fileURLToPath(import.meta.resolve(path, from)) : "url" in import.meta ? (path, from) => new URL(path, import.meta.url).pathname : require.resolve, resolverV2 = (path, from) => module.createRequire(from).resolve(path, { paths: [from] }), resolvePath = (path, from) => { | ||
try { | ||
return resolver(path, from); | ||
} catch { | ||
return resolverV2(path, from); | ||
} | ||
}; | ||
export { | ||
@@ -4,0 +11,0 @@ resolvePath |
@@ -0,1 +1,2 @@ | ||
import module from "node:module"; | ||
import { fileURLToPath } from "node:url"; | ||
@@ -6,4 +7,15 @@ var resolver = "resolve" in import.meta ? function(path, from) { | ||
return new URL(path, import.meta.url).pathname; | ||
} : require.resolve, resolvePath = function(path, from) { | ||
return resolver(path, from); | ||
} : require.resolve, resolverV2 = function(path, from) { | ||
var _$require = module.createRequire(from), importPath = _$require.resolve(path, { | ||
paths: [ | ||
from | ||
] | ||
}); | ||
return importPath; | ||
}, resolvePath = function(path, from) { | ||
try { | ||
return resolver(path, from); | ||
} catch { | ||
return resolverV2(path, from); | ||
} | ||
}; | ||
@@ -10,0 +22,0 @@ export { |
{ | ||
"name": "@vxrn/resolve", | ||
"version": "1.1.338", | ||
"version": "1.1.339", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
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
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
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
14886
214