@stryke/path 0.12.0 → 0.12.2

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 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
- async function resolvePackageSync(r, e = {}) {
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): Promise<string | undefined>;
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 async 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}
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.0",
3
+ "version": "0.12.2",
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": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "private": false,
12
12
  "dependencies": { "@storm-software/config-tools": "latest", "mlly": "1.7.4" },
13
- "devDependencies": { "@stryke/types": "^0.8.6", "@types/node": "^22.14.0" },
13
+ "devDependencies": { "@stryke/types": "^0.8.8", "@types/node": "^22.14.0" },
14
14
  "publishConfig": { "access": "public" },
15
15
  "sideEffects": false,
16
16
  "files": ["dist/**/*"],
@@ -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": "763abdbc096331d500df3ebb7a7e4387335c0d62"
277
+ "gitHead": "9ad3e3608ebc05bf2f02848ad83d50f5476c9f6f"
278
278
  }