@stryke/path 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/resolve.cjs +1 -1
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.mjs +1 -1
- package/package.json +2 -2
package/dist/resolve.cjs
CHANGED
|
@@ -53,7 +53,7 @@ async function resolvePackage(r, e = {}) {
|
|
|
53
53
|
let t = await resolveSafe((0, _joinPaths.joinPaths)(r, "package.json"), e);
|
|
54
54
|
return t || (t = await resolveSafe((0, _joinPaths.joinPaths)(r, "index.js"), e), t || (t = await resolveSafe(r, e))), t ? (0, _filePathFns.findFilePath)(t) : void 0;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
function resolvePackageSync(r, e = {}) {
|
|
57
57
|
let t = resolveSafeSync((0, _joinPaths.joinPaths)(r, "package.json"), e);
|
|
58
58
|
return t || (t = resolveSafeSync((0, _joinPaths.joinPaths)(r, "index.js"), e), t || (t = resolveSafeSync(r, e))), t ? (0, _filePathFns.findFilePath)(t) : void 0;
|
|
59
59
|
}
|
package/dist/resolve.d.ts
CHANGED
|
@@ -68,4 +68,4 @@ export declare function resolvePackage(name: string, options?: PackageResolvingO
|
|
|
68
68
|
* @param options - The options to use when resolving the module
|
|
69
69
|
* @returns The module or undefined
|
|
70
70
|
*/
|
|
71
|
-
export declare function resolvePackageSync(name: string, options?: PackageResolvingOptions):
|
|
71
|
+
export declare function resolvePackageSync(name: string, options?: PackageResolvingOptions): string | undefined;
|
package/dist/resolve.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{interopDefault as c,resolvePath as p,resolvePathSync as f}from"mlly";import{correctPath as s}from"./correct-path";import{findFilePath as i}from"./file-path-fns";import{getWorkspaceRoot as a}from"./get-workspace-root";import{joinPaths as o}from"./join-paths";export async function resolve(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(await p(r,{url:t}))}export function resolveSync(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(f(r,{url:e.paths}))}export async function resolveSafe(r,e={}){try{return await resolve(r,e)}catch{return}}export function resolveSafeSync(r,e={}){try{return resolveSync(r,e)}catch{return}}export async function importModule(r){const e=await import(r);return e&&c(e)}export async function resolvePackage(r,e={}){let t=await resolveSafe(o(r,"package.json"),e);return t||(t=await resolveSafe(o(r,"index.js"),e),t||(t=await resolveSafe(r,e))),t?i(t):void 0}export
|
|
1
|
+
import{interopDefault as c,resolvePath as p,resolvePathSync as f}from"mlly";import{correctPath as s}from"./correct-path";import{findFilePath as i}from"./file-path-fns";import{getWorkspaceRoot as a}from"./get-workspace-root";import{joinPaths as o}from"./join-paths";export async function resolve(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(await p(r,{url:t}))}export function resolveSync(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(f(r,{url:e.paths}))}export async function resolveSafe(r,e={}){try{return await resolve(r,e)}catch{return}}export function resolveSafeSync(r,e={}){try{return resolveSync(r,e)}catch{return}}export async function importModule(r){const e=await import(r);return e&&c(e)}export async function resolvePackage(r,e={}){let t=await resolveSafe(o(r,"package.json"),e);return t||(t=await resolveSafe(o(r,"index.js"),e),t||(t=await resolveSafe(r,e))),t?i(t):void 0}export function resolvePackageSync(r,e={}){let t=resolveSafeSync(o(r,"package.json"),e);return t||(t=resolveSafeSync(o(r,"index.js"),e),t||(t=resolveSafeSync(r,e))),t?i(t):void 0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/path",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various utilities that expand the functionality of NodeJs's built-in `path` module",
|
|
6
6
|
"repository": {
|
|
@@ -274,5 +274,5 @@
|
|
|
274
274
|
"main": "./dist/index.cjs",
|
|
275
275
|
"module": "./dist/index.mjs",
|
|
276
276
|
"types": "./dist/index.d.ts",
|
|
277
|
-
"gitHead": "
|
|
277
|
+
"gitHead": "366390ec25211fb6b36feed4bf0cffb7713253cb"
|
|
278
278
|
}
|