@stryke/path 0.23.2 → 0.24.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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ![Storm Software's logo banner](https://public.storm-cdn.com/storm-software/banner-1280x320.gif)
2
+
3
+ # Changelog for Stryke - Path
4
+
5
+ ## [0.24.0](https://github.com/storm-software/stryke/releases/tag/path%400.24.0) (12/19/2025)
6
+
7
+ ### Features
8
+
9
+ - **path:** Added the `commonPath` utility function
10
+ ([b1f4c43](https://github.com/storm-software/stryke/commit/b1f4c43))
11
+
12
+ ### Updated Dependencies
13
+
14
+ - Updated **type-checks** to **v0.5.14**
15
+ - Updated **convert** to **v0.6.29**
16
+ - Updated **types** to **v0.10.28**
17
+
18
+ ## [0.23.2](https://github.com/storm-software/stryke/releases/tag/path%400.23.2) (12/18/2025)
19
+
20
+ ### Bug Fixes
21
+
22
+ - **path:** Resolve issue with comparing paths in `isParentPath` helper function
23
+ ([545d053](https://github.com/storm-software/stryke/commit/545d053))
24
+
1
25
  ![Storm Software's logo banner](https://public.storm-cdn.com/storm-software/optimized/banner-1280x320.gif)
2
26
 
3
27
  # Changelog for Stryke - Path
@@ -15,10 +39,6 @@
15
39
  - Updated **convert** to **v0.6.28**
16
40
  - Updated **types** to **v0.10.27**
17
41
 
18
- ![Storm Software's logo banner](https://public.storm-cdn.com/storm-software/banner-1280x320.gif)
19
-
20
- # Changelog for Stryke - Path
21
-
22
42
  ## [0.23.0](https://github.com/storm-software/stryke/releases/tag/path%400.23.0) (12/18/2025)
23
43
 
24
44
  ### Features
package/README.md CHANGED
@@ -28,13 +28,13 @@ This package is part of Storm Software's **💥 Stryke** monorepo. Stryke packag
28
28
 
29
29
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
30
30
 
31
- [![Version](https://img.shields.io/badge/version-0.22.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
+ [![Version](https://img.shields.io/badge/version-0.22.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
32
32
 
33
33
  > [!IMPORTANT] Important
34
34
  > This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
35
35
 
36
36
  <div align="center">
37
- <b>Be sure to ⭐ this repository on <a href="https://github.com/storm-software/stryke" target="_blank">GitHub</a> so you can keep up to date on any daily progress!</b>
37
+ <a href="https://github.com/storm-software/stryke" target="_blank"><b>Be sure to ⭐ this repository on GitHub so you can keep up to date on any daily progress!</b></a>
38
38
  </div>
39
39
 
40
40
  <br />
@@ -0,0 +1 @@
1
+ const e=require(`./slash.cjs`),t=require(`./correct-path.cjs`);function n(n){let[r=``,...i]=n.map(n=>t.correctPath(e.slash(n)));if(!r)return``;if(i.length===0)return r;let a=r.split(`/`).length;for(let e of i){let t=e.split(`/`);for(let e=0;e<a;e++)t[e]!==r.split(`/`)[e]&&(a=e);if(a===0)return``}return t.withoutTrailingSlash(r.split(`/`).slice(0,a).join(`/`))}exports.commonPath=n;
@@ -0,0 +1,20 @@
1
+ //#region src/common.d.ts
2
+ /**
3
+ * Get the common path from an array of paths
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * commonPath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
8
+ * // returns '/foo/bar'
9
+ *
10
+ * commonPath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
11
+ * // returns 'C:/foo/bar'
12
+ * ```
13
+ *
14
+ * @param paths - The array of paths
15
+ * @returns The common path
16
+ */
17
+ declare function commonPath(paths: string[]): string;
18
+ //#endregion
19
+ export { commonPath };
20
+ //# sourceMappingURL=common.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.cts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;AAoCA;;;;;;;;;;;;;;iBAAgB,UAAA"}
@@ -0,0 +1,20 @@
1
+ //#region src/common.d.ts
2
+ /**
3
+ * Get the common path from an array of paths
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * commonPath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
8
+ * // returns '/foo/bar'
9
+ *
10
+ * commonPath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
11
+ * // returns 'C:/foo/bar'
12
+ * ```
13
+ *
14
+ * @param paths - The array of paths
15
+ * @returns The common path
16
+ */
17
+ declare function commonPath(paths: string[]): string;
18
+ //#endregion
19
+ export { commonPath };
20
+ //# sourceMappingURL=common.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.mts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;AAoCA;;;;;;;;;;;;;;iBAAgB,UAAA"}
@@ -0,0 +1,2 @@
1
+ import{slash as e}from"./slash.mjs";import{correctPath as t,withoutTrailingSlash as n}from"./correct-path.mjs";function r(r){let[i=``,...a]=r.map(n=>t(e(n)));if(!i)return``;if(a.length===0)return i;let o=i.split(`/`).length;for(let e of a){let t=e.split(`/`);for(let e=0;e<o;e++)t[e]!==i.split(`/`)[e]&&(o=e);if(o===0)return``}return n(i.split(`/`).slice(0,o).join(`/`))}export{r as commonPath};
2
+ //# sourceMappingURL=common.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.mjs","names":[],"sources":["../src/common.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { correctPath, withoutTrailingSlash } from \"./normalize\";\nimport { slash } from \"./slash\";\n\n/**\n * Get the common path from an array of paths\n *\n * @example\n * ```ts\n * commonPath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);\n * // returns '/foo/bar'\n *\n * commonPath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);\n * // returns 'C:/foo/bar'\n * ```\n *\n * @param paths - The array of paths\n * @returns The common path\n */\nexport function commonPath(paths: string[]): string {\n const [first = \"\", ...remaining] = paths.map(path =>\n correctPath(slash(path))\n );\n if (!first) {\n return \"\";\n }\n if (remaining.length === 0) {\n return first;\n }\n\n let endOfPrefix = first.split(\"/\").length;\n for (const path of remaining) {\n const compare = path.split(\"/\");\n for (let i = 0; i < endOfPrefix; i++) {\n if (compare[i] !== first.split(\"/\")[i]) {\n endOfPrefix = i;\n }\n }\n\n if (endOfPrefix === 0) {\n return \"\";\n }\n }\n\n return withoutTrailingSlash(first.split(\"/\").slice(0, endOfPrefix).join(\"/\"));\n}\n"],"mappings":"+GAoCA,SAAgB,EAAW,EAAyB,CAClD,GAAM,CAAC,EAAQ,GAAI,GAAG,GAAa,EAAM,IAAI,GAC3C,EAAY,EAAM,EAAK,CAAC,CACzB,CACD,GAAI,CAAC,EACH,MAAO,GAET,GAAI,EAAU,SAAW,EACvB,OAAO,EAGT,IAAI,EAAc,EAAM,MAAM,IAAI,CAAC,OACnC,IAAK,IAAM,KAAQ,EAAW,CAC5B,IAAM,EAAU,EAAK,MAAM,IAAI,CAC/B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAa,IAC3B,EAAQ,KAAO,EAAM,MAAM,IAAI,CAAC,KAClC,EAAc,GAIlB,GAAI,IAAgB,EAClB,MAAO,GAIX,OAAO,EAAqB,EAAM,MAAM,IAAI,CAAC,MAAM,EAAG,EAAY,CAAC,KAAK,IAAI,CAAC"}
@@ -1 +1 @@
1
- const e=require(`./cwd.cjs`),t=require(`./regex.cjs`),n=require(`./is-type.cjs`),r=require(`./slash.cjs`),i=require(`./join-paths.cjs`),a=require(`./append.cjs`);function o(e=``){return e&&r.slash(e).replace(t.DRIVE_LETTER_START_REGEX,e=>e.toUpperCase())}function s(e){if(!e||e.length===0)return`.`;e=o(e);let r=e.match(t.UNC_REGEX),i=n.isAbsolutePath(e),a=e.endsWith(`/`);return e=l(e,!i),e.length===0?i?`/`:a?`./`:`.`:(a&&(e+=`/`),t.DRIVE_LETTER_REGEX.test(e)&&(e+=`/`),r?i?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&i&&!t.DRIVE_LETTER_REGEX.test(e)?`/${e}`:e)}function c(e){if(!e||e.length===0)return`.`;e=s(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function l(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function u(t,i=e.cwd()){return n.isAbsolutePath(t)?t:r.slash(l(a.appendPath(t,i),!0))}function d(t,a=e.cwd()){return!t||t.length===0?`.`:(t=n.isAbsolutePath(t)?r.slash(l(t,!0)):r.slash(l(i.joinPaths(a,t),!0)),t.startsWith(`./`)?t.slice(2):t)}function f(e){let t=s(e);return t.endsWith(`/`)?t:`${t}/`}exports.correctPath=s,exports.normalizeString=l,exports.normalizeWindowsPath=o,exports.stripStars=c,exports.toAbsolutePath=u,exports.toRelativePath=d,exports.withTrailingSlash=f;
1
+ const e=require(`./cwd.cjs`),t=require(`./regex.cjs`),n=require(`./is-type.cjs`),r=require(`./slash.cjs`),i=require(`./join-paths.cjs`),a=require(`./append.cjs`);function o(e=``){return e&&r.slash(e).replace(t.DRIVE_LETTER_START_REGEX,e=>e.toUpperCase())}function s(e){if(!e||e.length===0)return`.`;e=o(e);let r=e.match(t.UNC_REGEX),i=n.isAbsolutePath(e),a=e.endsWith(`/`);return e=l(e,!i),e.length===0?i?`/`:a?`./`:`.`:(a&&(e+=`/`),t.DRIVE_LETTER_REGEX.test(e)&&(e+=`/`),r?i?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&i&&!t.DRIVE_LETTER_REGEX.test(e)?`/${e}`:e)}function c(e){if(!e||e.length===0)return`.`;e=s(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function l(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function u(t,i=e.cwd()){return n.isAbsolutePath(t)?t:r.slash(l(a.appendPath(t,i),!0))}function d(t,a=e.cwd()){return!t||t.length===0?`.`:(t=n.isAbsolutePath(t)?r.slash(l(t,!0)):r.slash(l(i.joinPaths(a,t),!0)),t.startsWith(`./`)?t.slice(2):t)}function f(e){let t=s(e);return t.endsWith(`/`)?t:`${t}/`}function p(e){let t=s(e);return t.endsWith(`/`)?t.slice(0,-1):t}exports.correctPath=s,exports.normalizeString=l,exports.normalizeWindowsPath=o,exports.stripStars=c,exports.toAbsolutePath=u,exports.toRelativePath=d,exports.withTrailingSlash=f,exports.withoutTrailingSlash=p;
@@ -54,6 +54,13 @@ declare function toRelativePath(path: string, cwd?: string): string;
54
54
  * @returns The modified path with a trailing slash.
55
55
  */
56
56
  declare function withTrailingSlash(path: string): string;
57
+ /**
58
+ * Removes a trailing slash from a path if it has one.
59
+ *
60
+ * @param path - The path to modify.
61
+ * @returns The modified path without a trailing slash.
62
+ */
63
+ declare function withoutTrailingSlash(path: string): string;
57
64
  //#endregion
58
- export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
65
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash };
59
66
  //# sourceMappingURL=correct-path.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"correct-path.d.cts","names":[],"sources":["../src/correct-path.ts"],"sourcesContent":[],"mappings":";iBA8BgB,oBAAA;AAAhB;AAcA;AA0DA;AA8BA;AA2EA;AAeA;AAwBgB,iBA1MA,WAAA,CA0MiB,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;iBAhJjB,UAAA;;;;;;;;iBA8BA,eAAA;;;;;;;;iBA2EA,cAAA;;;;;;;;iBAeA,cAAA;;;;;;;iBAwBA,iBAAA"}
1
+ {"version":3,"file":"correct-path.d.cts","names":[],"sources":["../src/correct-path.ts"],"sourcesContent":[],"mappings":";iBA8BgB,oBAAA;AAAhB;AAcA;AA0DA;AA8BA;AA2EA;AAeA;AAwBgB,iBA1MA,WAAA,CA0MiB,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAYjC;;;;;;;;;;;;;;;iBA5JgB,UAAA;;;;;;;;iBA8BA,eAAA;;;;;;;;iBA2EA,cAAA;;;;;;;;iBAeA,cAAA;;;;;;;iBAwBA,iBAAA;;;;;;;iBAYA,oBAAA"}
@@ -54,6 +54,13 @@ declare function toRelativePath(path: string, cwd?: string): string;
54
54
  * @returns The modified path with a trailing slash.
55
55
  */
56
56
  declare function withTrailingSlash(path: string): string;
57
+ /**
58
+ * Removes a trailing slash from a path if it has one.
59
+ *
60
+ * @param path - The path to modify.
61
+ * @returns The modified path without a trailing slash.
62
+ */
63
+ declare function withoutTrailingSlash(path: string): string;
57
64
  //#endregion
58
- export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
65
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash };
59
66
  //# sourceMappingURL=correct-path.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"correct-path.d.mts","names":[],"sources":["../src/correct-path.ts"],"sourcesContent":[],"mappings":";iBA8BgB,oBAAA;AAAhB;AAcA;AA0DA;AA8BA;AA2EA;AAeA;AAwBgB,iBA1MA,WAAA,CA0MiB,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;iBAhJjB,UAAA;;;;;;;;iBA8BA,eAAA;;;;;;;;iBA2EA,cAAA;;;;;;;;iBAeA,cAAA;;;;;;;iBAwBA,iBAAA"}
1
+ {"version":3,"file":"correct-path.d.mts","names":[],"sources":["../src/correct-path.ts"],"sourcesContent":[],"mappings":";iBA8BgB,oBAAA;AAAhB;AAcA;AA0DA;AA8BA;AA2EA;AAeA;AAwBgB,iBA1MA,WAAA,CA0MiB,IAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAYjC;;;;;;;;;;;;;;;iBA5JgB,UAAA;;;;;;;;iBA8BA,eAAA;;;;;;;;iBA2EA,cAAA;;;;;;;;iBAeA,cAAA;;;;;;;iBAwBA,iBAAA;;;;;;;iBAYA,oBAAA"}
@@ -1,2 +1,2 @@
1
- import{cwd as e}from"./cwd.mjs";import{DRIVE_LETTER_REGEX as t,DRIVE_LETTER_START_REGEX as n,UNC_REGEX as r}from"./regex.mjs";import{isAbsolutePath as i}from"./is-type.mjs";import{slash as a}from"./slash.mjs";import{joinPaths as o}from"./join-paths.mjs";import{appendPath as s}from"./append.mjs";function c(e=``){return e&&a(e).replace(n,e=>e.toUpperCase())}function l(e){if(!e||e.length===0)return`.`;e=c(e);let n=e.match(r),a=i(e),o=e.endsWith(`/`);return e=d(e,!a),e.length===0?a?`/`:o?`./`:`.`:(o&&(e+=`/`),t.test(e)&&(e+=`/`),n?a?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&a&&!t.test(e)?`/${e}`:e)}function u(e){if(!e||e.length===0)return`.`;e=l(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function d(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function f(t,n=e()){return i(t)?t:a(d(s(t,n),!0))}function p(t,n=e()){return!t||t.length===0?`.`:(t=i(t)?a(d(t,!0)):a(d(o(n,t),!0)),t.startsWith(`./`)?t.slice(2):t)}function m(e){let t=l(e);return t.endsWith(`/`)?t:`${t}/`}export{l as correctPath,d as normalizeString,c as normalizeWindowsPath,u as stripStars,f as toAbsolutePath,p as toRelativePath,m as withTrailingSlash};
1
+ import{cwd as e}from"./cwd.mjs";import{DRIVE_LETTER_REGEX as t,DRIVE_LETTER_START_REGEX as n,UNC_REGEX as r}from"./regex.mjs";import{isAbsolutePath as i}from"./is-type.mjs";import{slash as a}from"./slash.mjs";import{joinPaths as o}from"./join-paths.mjs";import{appendPath as s}from"./append.mjs";function c(e=``){return e&&a(e).replace(n,e=>e.toUpperCase())}function l(e){if(!e||e.length===0)return`.`;e=c(e);let n=e.match(r),a=i(e),o=e.endsWith(`/`);return e=d(e,!a),e.length===0?a?`/`:o?`./`:`.`:(o&&(e+=`/`),t.test(e)&&(e+=`/`),n?a?`//${e}`:`//./${e}`:!e.startsWith(`/`)&&a&&!t.test(e)?`/${e}`:e)}function u(e){if(!e||e.length===0)return`.`;e=l(e);let t=!1;return e.split(`/`).reduce((e,n)=>n?.trim()?t||n.includes(`*`)?(t=!0,e):e+(e?`/${n}`:n):e,``)}function d(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function f(t,n=e()){return i(t)?t:a(d(s(t,n),!0))}function p(t,n=e()){return!t||t.length===0?`.`:(t=i(t)?a(d(t,!0)):a(d(o(n,t),!0)),t.startsWith(`./`)?t.slice(2):t)}function m(e){let t=l(e);return t.endsWith(`/`)?t:`${t}/`}function h(e){let t=l(e);return t.endsWith(`/`)?t.slice(0,-1):t}export{l as correctPath,d as normalizeString,c as normalizeWindowsPath,u as stripStars,f as toAbsolutePath,p as toRelativePath,m as withTrailingSlash,h as withoutTrailingSlash};
2
2
  //# sourceMappingURL=correct-path.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"correct-path.mjs","names":["char: string | null","currentDir","cwd"],"sources":["../src/correct-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { appendPath } from \"./append\";\nimport { cwd as currentDir } from \"./cwd\";\nimport { isAbsolutePath } from \"./is-type\";\nimport { joinPaths } from \"./join-paths\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\nimport { slash } from \"./slash\";\n\n// Util to normalize windows paths to posix\nexport function normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n\n return slash(input).replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\n/**\n * Corrects/normalized a file path.\n *\n * @param path - The path to correct.\n * @returns The corrected path.\n */\nexport function correctPath(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n // Normalize windows argument\n path = normalizeWindowsPath(path);\n\n const isUNCPath = path.match(UNC_REGEX);\n const isPathAbsolute = isAbsolutePath(path);\n const trailingSeparator = path.endsWith(\"/\");\n\n // Normalize the path\n path = normalizeString(path, !isPathAbsolute);\n\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_REGEX.test(path)) {\n path += \"/\";\n }\n\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n\n return !path.startsWith(\"/\") &&\n isPathAbsolute &&\n !DRIVE_LETTER_REGEX.test(path)\n ? `/${path}`\n : path;\n}\n\n/**\n * Remove any star tokens (*) from the end of the file path\n *\n * @example\n * stripStars(\"src/**\") // returns \"src\"\n * stripStars(\"src/*\") // returns \"src\"\n * stripStars(\"src/**\\/*\") // returns \"src\"\n * stripStars(\"src/**\\/*.txt\") // returns \"src\"\n * stripStars(\"src/**\\/file.txt\") // returns \"src\"\n * stripStars(\"src/file.txt\") // returns \"src/file.txt\"\n * stripStars(\"\") // returns \".\"\n *\n * @param path - The path to correct.\n * @returns The corrected path.\n */\nexport function stripStars(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n path = correctPath(path);\n\n let found = false;\n\n return path.split(\"/\").reduce((ret, segment) => {\n if (!segment?.trim()) {\n return ret;\n }\n\n if (found || segment.includes(\"*\")) {\n found = true;\n return ret;\n }\n\n return ret + (ret ? `/${segment}` : segment);\n }, \"\");\n}\n\n/**\n * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n *\n * @param path - The path to normalize.\n * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n * @returns the normalize path string.\n */\nexport function normalizeString(path: string, allowAboveRoot: boolean) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char: string | null = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n // casted because we know it exists thanks to the length check\n char = path[index] as string;\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res[res.length - 1] !== \".\" ||\n res[res.length - 2] !== \".\"\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\n/**\n * Converts a given path to an absolute path based on the current working directory.\n *\n * @param path - The path to convert to an absolute path.\n * @param cwd - The current working directory to use as the base path if the path is not absolute.\n * @returns The absolute path.\n */\nexport function toAbsolutePath(path: string, cwd = currentDir()): string {\n if (isAbsolutePath(path)) {\n return path;\n }\n\n return slash(normalizeString(appendPath(path, cwd), true));\n}\n\n/**\n * Converts a given path to a relative path based on the current working directory.\n *\n * @param path - The path to convert to a relative path.\n * @param cwd - The current working directory to use as the base path if the path is not absolute.\n * @returns The relative path.\n */\nexport function toRelativePath(path: string, cwd = currentDir()): string {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n if (isAbsolutePath(path)) {\n path = slash(normalizeString(path, true));\n } else {\n path = slash(normalizeString(joinPaths(cwd, path), true));\n }\n\n if (path.startsWith(\"./\")) {\n return path.slice(2);\n }\n\n return path;\n}\n\n/**\n * Adds a trailing slash to a path if it doesn't already have one.\n *\n * @param path - The path to modify.\n * @returns The modified path with a trailing slash.\n */\nexport function withTrailingSlash(path: string): string {\n const result = correctPath(path);\n\n return result.endsWith(\"/\") ? result : `${result}/`;\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"correct-path.mjs","names":["char: string | null","currentDir","cwd"],"sources":["../src/correct-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { appendPath } from \"./append\";\nimport { cwd as currentDir } from \"./cwd\";\nimport { isAbsolutePath } from \"./is-type\";\nimport { joinPaths } from \"./join-paths\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\nimport { slash } from \"./slash\";\n\n// Util to normalize windows paths to posix\nexport function normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n\n return slash(input).replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\n/**\n * Corrects/normalized a file path.\n *\n * @param path - The path to correct.\n * @returns The corrected path.\n */\nexport function correctPath(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n // Normalize windows argument\n path = normalizeWindowsPath(path);\n\n const isUNCPath = path.match(UNC_REGEX);\n const isPathAbsolute = isAbsolutePath(path);\n const trailingSeparator = path.endsWith(\"/\");\n\n // Normalize the path\n path = normalizeString(path, !isPathAbsolute);\n\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_REGEX.test(path)) {\n path += \"/\";\n }\n\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n\n return !path.startsWith(\"/\") &&\n isPathAbsolute &&\n !DRIVE_LETTER_REGEX.test(path)\n ? `/${path}`\n : path;\n}\n\n/**\n * Remove any star tokens (*) from the end of the file path\n *\n * @example\n * stripStars(\"src/**\") // returns \"src\"\n * stripStars(\"src/*\") // returns \"src\"\n * stripStars(\"src/**\\/*\") // returns \"src\"\n * stripStars(\"src/**\\/*.txt\") // returns \"src\"\n * stripStars(\"src/**\\/file.txt\") // returns \"src\"\n * stripStars(\"src/file.txt\") // returns \"src/file.txt\"\n * stripStars(\"\") // returns \".\"\n *\n * @param path - The path to correct.\n * @returns The corrected path.\n */\nexport function stripStars(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n path = correctPath(path);\n\n let found = false;\n\n return path.split(\"/\").reduce((ret, segment) => {\n if (!segment?.trim()) {\n return ret;\n }\n\n if (found || segment.includes(\"*\")) {\n found = true;\n return ret;\n }\n\n return ret + (ret ? `/${segment}` : segment);\n }, \"\");\n}\n\n/**\n * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n *\n * @param path - The path to normalize.\n * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n * @returns the normalize path string.\n */\nexport function normalizeString(path: string, allowAboveRoot: boolean) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char: string | null = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n // casted because we know it exists thanks to the length check\n char = path[index] as string;\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res[res.length - 1] !== \".\" ||\n res[res.length - 2] !== \".\"\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\n/**\n * Converts a given path to an absolute path based on the current working directory.\n *\n * @param path - The path to convert to an absolute path.\n * @param cwd - The current working directory to use as the base path if the path is not absolute.\n * @returns The absolute path.\n */\nexport function toAbsolutePath(path: string, cwd = currentDir()): string {\n if (isAbsolutePath(path)) {\n return path;\n }\n\n return slash(normalizeString(appendPath(path, cwd), true));\n}\n\n/**\n * Converts a given path to a relative path based on the current working directory.\n *\n * @param path - The path to convert to a relative path.\n * @param cwd - The current working directory to use as the base path if the path is not absolute.\n * @returns The relative path.\n */\nexport function toRelativePath(path: string, cwd = currentDir()): string {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n if (isAbsolutePath(path)) {\n path = slash(normalizeString(path, true));\n } else {\n path = slash(normalizeString(joinPaths(cwd, path), true));\n }\n\n if (path.startsWith(\"./\")) {\n return path.slice(2);\n }\n\n return path;\n}\n\n/**\n * Adds a trailing slash to a path if it doesn't already have one.\n *\n * @param path - The path to modify.\n * @returns The modified path with a trailing slash.\n */\nexport function withTrailingSlash(path: string): string {\n const result = correctPath(path);\n\n return result.endsWith(\"/\") ? result : `${result}/`;\n}\n\n/**\n * Removes a trailing slash from a path if it has one.\n *\n * @param path - The path to modify.\n * @returns The modified path without a trailing slash.\n */\nexport function withoutTrailingSlash(path: string): string {\n const result = correctPath(path);\n\n return result.endsWith(\"/\") ? result.slice(0, -1) : result;\n}\n"],"mappings":"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"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- const e=require(`./cwd.cjs`),t=require(`./regex.cjs`),n=require(`./slash.cjs`),r=require(`./is-parent-path.cjs`),i=require(`./join-paths.cjs`),a=require(`./append.cjs`),o=require(`./asset-extensions.cjs`),s=require(`./correct-path.cjs`),c=require(`./delimiter.cjs`),l=require(`./file-path-fns.cjs`),u=require(`./is-root-dir.cjs`),d=require(`./replace.cjs`),f=require(`./resolve-parent-path.cjs`);exports.ABSOLUTE_PATH_REGEX=t.ABSOLUTE_PATH_REGEX,exports.DEFAULT_ASSET_EXTS=o.DEFAULT_ASSET_EXTS,exports.DRIVE_LETTER_REGEX=t.DRIVE_LETTER_REGEX,exports.DRIVE_LETTER_START_REGEX=t.DRIVE_LETTER_START_REGEX,exports.FILE_EXTENSION_REGEX=t.FILE_EXTENSION_REGEX,exports.NPM_SCOPED_PACKAGE_REGEX=t.NPM_SCOPED_PACKAGE_REGEX,exports.PACKAGE_PATH_REGEX=t.PACKAGE_PATH_REGEX,exports.ROOT_FOLDER_REGEX=t.ROOT_FOLDER_REGEX,exports.UNC_REGEX=t.UNC_REGEX,exports.append=a.append,exports.appendExtension=a.appendExtension,exports.appendPath=a.appendPath,exports.basename=l.basename,exports.correctPath=s.correctPath,exports.cwd=e.cwd,exports.delimiter=c.delimiter,exports.dirname=l.dirname,exports.extname=l.extname,exports.findFileDotExtension=l.findFileDotExtension,exports.findFileDotExtensionSafe=l.findFileDotExtensionSafe,exports.findFileExtension=l.findFileExtension,exports.findFileExtensionSafe=l.findFileExtensionSafe,exports.findFileName=l.findFileName,exports.findFilePath=l.findFilePath,exports.findFolderName=l.findFolderName,exports.formatSlash=n.formatSlash,exports.hasFileExtension=l.hasFileExtension,exports.hasFileName=l.hasFileName,exports.hasFilePath=l.hasFilePath,exports.hasFolderName=l.hasFolderName,exports.isParentPath=r.isParentPath,exports.isSystemRoot=u.isSystemRoot,exports.join=i.join,exports.joinPaths=i.joinPaths,exports.normalizeString=s.normalizeString,exports.normalizeWindowsPath=s.normalizeWindowsPath,exports.parsePath=l.parsePath,exports.posix=c.posix,exports.relative=l.relative,exports.relativePath=l.relativePath,exports.relativeToCurrentDir=l.relativeToCurrentDir,exports.renameFile=l.renameFile,exports.replaceExtension=d.replaceExtension,exports.replacePath=d.replacePath,exports.resolve=l.resolve,exports.resolveParentPath=f.resolveParentPath,exports.resolvePath=l.resolvePath,exports.resolvePaths=l.resolvePaths,exports.slash=n.slash,exports.stripStars=s.stripStars,exports.toAbsolutePath=s.toAbsolutePath,exports.toRelativePath=s.toRelativePath,exports.win32=c.win32,exports.withTrailingSlash=s.withTrailingSlash;
1
+ const e=require(`./cwd.cjs`),t=require(`./regex.cjs`),n=require(`./slash.cjs`),r=require(`./is-parent-path.cjs`),i=require(`./join-paths.cjs`),a=require(`./append.cjs`),o=require(`./asset-extensions.cjs`),s=require(`./correct-path.cjs`),c=require(`./common.cjs`),l=require(`./delimiter.cjs`),u=require(`./file-path-fns.cjs`),d=require(`./is-root-dir.cjs`),f=require(`./replace.cjs`),p=require(`./resolve-parent-path.cjs`);exports.ABSOLUTE_PATH_REGEX=t.ABSOLUTE_PATH_REGEX,exports.DEFAULT_ASSET_EXTS=o.DEFAULT_ASSET_EXTS,exports.DRIVE_LETTER_REGEX=t.DRIVE_LETTER_REGEX,exports.DRIVE_LETTER_START_REGEX=t.DRIVE_LETTER_START_REGEX,exports.FILE_EXTENSION_REGEX=t.FILE_EXTENSION_REGEX,exports.NPM_SCOPED_PACKAGE_REGEX=t.NPM_SCOPED_PACKAGE_REGEX,exports.PACKAGE_PATH_REGEX=t.PACKAGE_PATH_REGEX,exports.ROOT_FOLDER_REGEX=t.ROOT_FOLDER_REGEX,exports.UNC_REGEX=t.UNC_REGEX,exports.append=a.append,exports.appendExtension=a.appendExtension,exports.appendPath=a.appendPath,exports.basename=u.basename,exports.commonPath=c.commonPath,exports.correctPath=s.correctPath,exports.cwd=e.cwd,exports.delimiter=l.delimiter,exports.dirname=u.dirname,exports.extname=u.extname,exports.findFileDotExtension=u.findFileDotExtension,exports.findFileDotExtensionSafe=u.findFileDotExtensionSafe,exports.findFileExtension=u.findFileExtension,exports.findFileExtensionSafe=u.findFileExtensionSafe,exports.findFileName=u.findFileName,exports.findFilePath=u.findFilePath,exports.findFolderName=u.findFolderName,exports.formatSlash=n.formatSlash,exports.hasFileExtension=u.hasFileExtension,exports.hasFileName=u.hasFileName,exports.hasFilePath=u.hasFilePath,exports.hasFolderName=u.hasFolderName,exports.isParentPath=r.isParentPath,exports.isSystemRoot=d.isSystemRoot,exports.join=i.join,exports.joinPaths=i.joinPaths,exports.normalizeString=s.normalizeString,exports.normalizeWindowsPath=s.normalizeWindowsPath,exports.parsePath=u.parsePath,exports.posix=l.posix,exports.relative=u.relative,exports.relativePath=u.relativePath,exports.relativeToCurrentDir=u.relativeToCurrentDir,exports.renameFile=u.renameFile,exports.replaceExtension=f.replaceExtension,exports.replacePath=f.replacePath,exports.resolve=u.resolve,exports.resolveParentPath=p.resolveParentPath,exports.resolvePath=u.resolvePath,exports.resolvePaths=u.resolvePaths,exports.slash=n.slash,exports.stripStars=s.stripStars,exports.toAbsolutePath=s.toAbsolutePath,exports.toRelativePath=s.toRelativePath,exports.win32=l.win32,exports.withTrailingSlash=s.withTrailingSlash,exports.withoutTrailingSlash=s.withoutTrailingSlash;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AppendPathOptions, append, appendExtension, appendPath } from "./append.cjs";
2
2
  import { DEFAULT_ASSET_EXTS } from "./asset-extensions.cjs";
3
- import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash } from "./correct-path.cjs";
3
+ import { commonPath } from "./common.cjs";
4
+ import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.cjs";
4
5
  import { cwd } from "./cwd.cjs";
5
6
  import { delimiter, posix, win32 } from "./delimiter.cjs";
6
7
  import { FindFileNameOptions, basename, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, hasFileExtension, hasFileName, hasFilePath, hasFolderName, parsePath, relative, relativePath, relativeToCurrentDir, renameFile, resolve, resolvePath, resolvePaths } from "./file-path-fns.cjs";
@@ -11,4 +12,4 @@ import { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE
11
12
  import { replaceExtension, replacePath } from "./replace.cjs";
12
13
  import { resolveParentPath } from "./resolve-parent-path.cjs";
13
14
  import { formatSlash, slash } from "./slash.cjs";
14
- export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FindFileNameOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash };
15
+ export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FindFileNameOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AppendPathOptions, append, appendExtension, appendPath } from "./append.mjs";
2
2
  import { DEFAULT_ASSET_EXTS } from "./asset-extensions.mjs";
3
- import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash } from "./correct-path.mjs";
3
+ import { commonPath } from "./common.mjs";
4
+ import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.mjs";
4
5
  import { cwd } from "./cwd.mjs";
5
6
  import { delimiter, posix, win32 } from "./delimiter.mjs";
6
7
  import { FindFileNameOptions, basename, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, hasFileExtension, hasFileName, hasFilePath, hasFolderName, parsePath, relative, relativePath, relativeToCurrentDir, renameFile, resolve, resolvePath, resolvePaths } from "./file-path-fns.mjs";
@@ -11,4 +12,4 @@ import { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE
11
12
  import { replaceExtension, replacePath } from "./replace.mjs";
12
13
  import { resolveParentPath } from "./resolve-parent-path.mjs";
13
14
  import { formatSlash, slash } from "./slash.mjs";
14
- export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FindFileNameOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash };
15
+ export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FindFileNameOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{cwd as e}from"./cwd.mjs";import{ABSOLUTE_PATH_REGEX as t,DRIVE_LETTER_REGEX as n,DRIVE_LETTER_START_REGEX as r,FILE_EXTENSION_REGEX as i,NPM_SCOPED_PACKAGE_REGEX as a,PACKAGE_PATH_REGEX as o,ROOT_FOLDER_REGEX as s,UNC_REGEX as c}from"./regex.mjs";import{formatSlash as l,slash as u}from"./slash.mjs";import{isParentPath as d}from"./is-parent-path.mjs";import{join as f,joinPaths as p}from"./join-paths.mjs";import{append as m,appendExtension as h,appendPath as g}from"./append.mjs";import{DEFAULT_ASSET_EXTS as _}from"./asset-extensions.mjs";import{correctPath as v,normalizeString as y,normalizeWindowsPath as b,stripStars as x,toAbsolutePath as S,toRelativePath as C,withTrailingSlash as w}from"./correct-path.mjs";import{delimiter as T,posix as E,win32 as D}from"./delimiter.mjs";import{basename as O,dirname as k,extname as A,findFileDotExtension as j,findFileDotExtensionSafe as M,findFileExtension as N,findFileExtensionSafe as P,findFileName as F,findFilePath as I,findFolderName as L,hasFileExtension as R,hasFileName as z,hasFilePath as B,hasFolderName as V,parsePath as H,relative as U,relativePath as W,relativeToCurrentDir as G,renameFile as K,resolve as q,resolvePath as J,resolvePaths as Y}from"./file-path-fns.mjs";import{isSystemRoot as X}from"./is-root-dir.mjs";import{replaceExtension as Z,replacePath as Q}from"./replace.mjs";import{resolveParentPath as $}from"./resolve-parent-path.mjs";export{t as ABSOLUTE_PATH_REGEX,_ as DEFAULT_ASSET_EXTS,n as DRIVE_LETTER_REGEX,r as DRIVE_LETTER_START_REGEX,i as FILE_EXTENSION_REGEX,a as NPM_SCOPED_PACKAGE_REGEX,o as PACKAGE_PATH_REGEX,s as ROOT_FOLDER_REGEX,c as UNC_REGEX,m as append,h as appendExtension,g as appendPath,O as basename,v as correctPath,e as cwd,T as delimiter,k as dirname,A as extname,j as findFileDotExtension,M as findFileDotExtensionSafe,N as findFileExtension,P as findFileExtensionSafe,F as findFileName,I as findFilePath,L as findFolderName,l as formatSlash,R as hasFileExtension,z as hasFileName,B as hasFilePath,V as hasFolderName,d as isParentPath,X as isSystemRoot,f as join,p as joinPaths,y as normalizeString,b as normalizeWindowsPath,H as parsePath,E as posix,U as relative,W as relativePath,G as relativeToCurrentDir,K as renameFile,Z as replaceExtension,Q as replacePath,q as resolve,$ as resolveParentPath,J as resolvePath,Y as resolvePaths,u as slash,x as stripStars,S as toAbsolutePath,C as toRelativePath,D as win32,w as withTrailingSlash};
1
+ import{cwd as e}from"./cwd.mjs";import{ABSOLUTE_PATH_REGEX as t,DRIVE_LETTER_REGEX as n,DRIVE_LETTER_START_REGEX as r,FILE_EXTENSION_REGEX as i,NPM_SCOPED_PACKAGE_REGEX as a,PACKAGE_PATH_REGEX as o,ROOT_FOLDER_REGEX as s,UNC_REGEX as c}from"./regex.mjs";import{formatSlash as l,slash as u}from"./slash.mjs";import{isParentPath as d}from"./is-parent-path.mjs";import{join as f,joinPaths as p}from"./join-paths.mjs";import{append as m,appendExtension as h,appendPath as g}from"./append.mjs";import{DEFAULT_ASSET_EXTS as _}from"./asset-extensions.mjs";import{correctPath as v,normalizeString as y,normalizeWindowsPath as b,stripStars as x,toAbsolutePath as S,toRelativePath as C,withTrailingSlash as w,withoutTrailingSlash as T}from"./correct-path.mjs";import{commonPath as E}from"./common.mjs";import{delimiter as D,posix as O,win32 as k}from"./delimiter.mjs";import{basename as A,dirname as j,extname as M,findFileDotExtension as N,findFileDotExtensionSafe as P,findFileExtension as F,findFileExtensionSafe as I,findFileName as L,findFilePath as R,findFolderName as z,hasFileExtension as B,hasFileName as V,hasFilePath as H,hasFolderName as U,parsePath as W,relative as G,relativePath as K,relativeToCurrentDir as q,renameFile as J,resolve as Y,resolvePath as X,resolvePaths as Z}from"./file-path-fns.mjs";import{isSystemRoot as Q}from"./is-root-dir.mjs";import{replaceExtension as $,replacePath as ee}from"./replace.mjs";import{resolveParentPath as te}from"./resolve-parent-path.mjs";export{t as ABSOLUTE_PATH_REGEX,_ as DEFAULT_ASSET_EXTS,n as DRIVE_LETTER_REGEX,r as DRIVE_LETTER_START_REGEX,i as FILE_EXTENSION_REGEX,a as NPM_SCOPED_PACKAGE_REGEX,o as PACKAGE_PATH_REGEX,s as ROOT_FOLDER_REGEX,c as UNC_REGEX,m as append,h as appendExtension,g as appendPath,A as basename,E as commonPath,v as correctPath,e as cwd,D as delimiter,j as dirname,M as extname,N as findFileDotExtension,P as findFileDotExtensionSafe,F as findFileExtension,I as findFileExtensionSafe,L as findFileName,R as findFilePath,z as findFolderName,l as formatSlash,B as hasFileExtension,V as hasFileName,H as hasFilePath,U as hasFolderName,d as isParentPath,Q as isSystemRoot,f as join,p as joinPaths,y as normalizeString,b as normalizeWindowsPath,W as parsePath,O as posix,G as relative,K as relativePath,q as relativeToCurrentDir,J as renameFile,$ as replaceExtension,ee as replacePath,Y as resolve,te as resolveParentPath,X as resolvePath,Z as resolvePaths,u as slash,x as stripStars,S as toAbsolutePath,C as toRelativePath,k as win32,w as withTrailingSlash,T as withoutTrailingSlash};
@@ -1 +1 @@
1
- const e=require(`./correct-path.cjs`);exports.correctPath=e.correctPath,exports.normalizeString=e.normalizeString,exports.normalizeWindowsPath=e.normalizeWindowsPath,exports.stripStars=e.stripStars,exports.toAbsolutePath=e.toAbsolutePath,exports.toRelativePath=e.toRelativePath,exports.withTrailingSlash=e.withTrailingSlash;
1
+ const e=require(`./correct-path.cjs`);exports.correctPath=e.correctPath,exports.normalizeString=e.normalizeString,exports.normalizeWindowsPath=e.normalizeWindowsPath,exports.stripStars=e.stripStars,exports.toAbsolutePath=e.toAbsolutePath,exports.toRelativePath=e.toRelativePath,exports.withTrailingSlash=e.withTrailingSlash,exports.withoutTrailingSlash=e.withoutTrailingSlash;
@@ -1,2 +1,2 @@
1
- import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash } from "./correct-path.cjs";
2
- export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
1
+ import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.cjs";
2
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash };
@@ -1,2 +1,2 @@
1
- import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash } from "./correct-path.mjs";
2
- export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
1
+ import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.mjs";
2
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash };
@@ -1 +1 @@
1
- import{correctPath as e,normalizeString as t,normalizeWindowsPath as n,stripStars as r,toAbsolutePath as i,toRelativePath as a,withTrailingSlash as o}from"./correct-path.mjs";export{e as correctPath,t as normalizeString,n as normalizeWindowsPath,r as stripStars,i as toAbsolutePath,a as toRelativePath,o as withTrailingSlash};
1
+ import{correctPath as e,normalizeString as t,normalizeWindowsPath as n,stripStars as r,toAbsolutePath as i,toRelativePath as a,withTrailingSlash as o,withoutTrailingSlash as s}from"./correct-path.mjs";export{e as correctPath,t as normalizeString,n as normalizeWindowsPath,r as stripStars,i as toAbsolutePath,a as toRelativePath,o as withTrailingSlash,s as withoutTrailingSlash};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/path",
3
- "version": "0.23.2",
3
+ "version": "0.24.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": {
@@ -21,6 +21,10 @@
21
21
  "require": "./dist/asset-extensions.cjs",
22
22
  "import": "./dist/asset-extensions.mjs"
23
23
  },
24
+ "./common": {
25
+ "require": "./dist/common.cjs",
26
+ "import": "./dist/common.mjs"
27
+ },
24
28
  "./correct-path": {
25
29
  "require": "./dist/correct-path.cjs",
26
30
  "import": "./dist/correct-path.mjs"
@@ -70,12 +74,12 @@
70
74
  },
71
75
  "types": "./dist/index.d.cts",
72
76
  "devDependencies": {
73
- "@storm-software/testing-tools": "^1.119.71",
74
- "@stryke/convert": "^0.6.28",
75
- "@stryke/type-checks": "^0.5.13",
76
- "@stryke/types": "^0.10.27",
77
+ "@storm-software/testing-tools": "^1.119.73",
78
+ "@stryke/convert": "^0.6.30",
79
+ "@stryke/type-checks": "^0.5.15",
80
+ "@stryke/types": "^0.10.29",
77
81
  "tsdown": "^0.17.2"
78
82
  },
79
83
  "publishConfig": { "access": "public" },
80
- "gitHead": "562e4b64add5e6c076ae803315d2768582148620"
84
+ "gitHead": "b8d274b5ccadc794cda7e8f417b68e640fa97641"
81
85
  }