@stryke/path 0.21.6 → 0.22.7

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.
Files changed (175) hide show
  1. package/CHANGELOG.md +735 -0
  2. package/README.md +28 -22
  3. package/dist/append-BWRdnlxE.cjs +1 -0
  4. package/dist/{append.d.ts → append-DfRQvWY6.d.cts} +7 -3
  5. package/dist/append-DfRQvWY6.d.cts.map +1 -0
  6. package/dist/append-tFFvRN-V.d.mts +38 -0
  7. package/dist/append-tFFvRN-V.d.mts.map +1 -0
  8. package/dist/append-xQ5toDGS.mjs +2 -0
  9. package/dist/append-xQ5toDGS.mjs.map +1 -0
  10. package/dist/append.cjs +1 -19
  11. package/dist/append.d.cts +2 -0
  12. package/dist/append.d.mts +2 -0
  13. package/dist/append.mjs +1 -1
  14. package/dist/asset-extensions-BFW_s97B.mjs +2 -0
  15. package/dist/asset-extensions-BFW_s97B.mjs.map +1 -0
  16. package/dist/{asset-extensions.d.ts → asset-extensions-D-_39huh.d.cts} +5 -1
  17. package/dist/asset-extensions-D-_39huh.d.cts.map +1 -0
  18. package/dist/asset-extensions-DNMkK37t.cjs +1 -0
  19. package/dist/asset-extensions-DlN384ac.d.mts +11 -0
  20. package/dist/asset-extensions-DlN384ac.d.mts.map +1 -0
  21. package/dist/asset-extensions.cjs +1 -7
  22. package/dist/asset-extensions.d.cts +2 -0
  23. package/dist/asset-extensions.d.mts +2 -0
  24. package/dist/asset-extensions.mjs +1 -1
  25. package/dist/correct-path-B0Y_kOkW.cjs +1 -0
  26. package/dist/{correct-path.d.ts → correct-path-CwHhpk6I.d.cts} +11 -7
  27. package/dist/correct-path-CwHhpk6I.d.cts.map +1 -0
  28. package/dist/correct-path-DmaZHNUF.mjs +2 -0
  29. package/dist/correct-path-DmaZHNUF.mjs.map +1 -0
  30. package/dist/correct-path-LC5QqYV-.d.mts +59 -0
  31. package/dist/correct-path-LC5QqYV-.d.mts.map +1 -0
  32. package/dist/correct-path.cjs +1 -75
  33. package/dist/correct-path.d.cts +2 -0
  34. package/dist/correct-path.d.mts +2 -0
  35. package/dist/correct-path.mjs +1 -1
  36. package/dist/{cwd.d.ts → cwd-Bt4NcS-v.d.cts} +5 -1
  37. package/dist/cwd-Bt4NcS-v.d.cts.map +1 -0
  38. package/dist/cwd-D66SsPHE.cjs +1 -0
  39. package/dist/cwd-Dx53cgUn.d.mts +13 -0
  40. package/dist/cwd-Dx53cgUn.d.mts.map +1 -0
  41. package/dist/cwd-DxrPG9WB.mjs +2 -0
  42. package/dist/cwd-DxrPG9WB.mjs.map +1 -0
  43. package/dist/cwd.cjs +1 -9
  44. package/dist/cwd.d.cts +2 -0
  45. package/dist/cwd.d.mts +2 -0
  46. package/dist/cwd.mjs +1 -1
  47. package/dist/delimiter-B3nWo9Xn.mjs +2 -0
  48. package/dist/delimiter-B3nWo9Xn.mjs.map +1 -0
  49. package/dist/delimiter-BwyCEwu9.d.cts +22 -0
  50. package/dist/delimiter-BwyCEwu9.d.cts.map +1 -0
  51. package/dist/delimiter-DuDX7fvN.d.mts +22 -0
  52. package/dist/delimiter-DuDX7fvN.d.mts.map +1 -0
  53. package/dist/delimiter-IA9U4fxC.cjs +1 -0
  54. package/dist/delimiter.cjs +1 -18
  55. package/dist/delimiter.d.cts +2 -0
  56. package/dist/delimiter.d.mts +2 -0
  57. package/dist/delimiter.mjs +1 -1
  58. package/dist/file-path-fns-B9hKjfA-.cjs +1 -0
  59. package/dist/{file-path-fns.d.ts → file-path-fns-BKbfZRTB.d.mts} +46 -40
  60. package/dist/file-path-fns-BKbfZRTB.d.mts.map +1 -0
  61. package/dist/file-path-fns-CTLJP4j9.d.cts +218 -0
  62. package/dist/file-path-fns-CTLJP4j9.d.cts.map +1 -0
  63. package/dist/file-path-fns-MRI3PV8K.mjs +2 -0
  64. package/dist/file-path-fns-MRI3PV8K.mjs.map +1 -0
  65. package/dist/file-path-fns.cjs +1 -150
  66. package/dist/file-path-fns.d.cts +2 -0
  67. package/dist/file-path-fns.d.mts +2 -0
  68. package/dist/file-path-fns.mjs +1 -1
  69. package/dist/find.cjs +1 -16
  70. package/dist/find.d.cts +2 -0
  71. package/dist/find.d.mts +2 -0
  72. package/dist/find.mjs +1 -1
  73. package/dist/index.cjs +1 -148
  74. package/dist/index.d.cts +14 -0
  75. package/dist/index.d.mts +14 -0
  76. package/dist/index.mjs +1 -1
  77. package/dist/{is-parent-path.d.ts → is-parent-path-B1EPPZ08.d.cts} +5 -1
  78. package/dist/is-parent-path-B1EPPZ08.d.cts.map +1 -0
  79. package/dist/is-parent-path-BW6CsB2o.d.mts +26 -0
  80. package/dist/is-parent-path-BW6CsB2o.d.mts.map +1 -0
  81. package/dist/is-parent-path-C0Azmjnd.mjs +2 -0
  82. package/dist/is-parent-path-C0Azmjnd.mjs.map +1 -0
  83. package/dist/is-parent-path-ChIi6oAO.cjs +1 -0
  84. package/dist/is-parent-path.cjs +1 -12
  85. package/dist/is-parent-path.d.cts +2 -0
  86. package/dist/is-parent-path.d.mts +2 -0
  87. package/dist/is-parent-path.mjs +1 -1
  88. package/dist/is-root-dir-BzQKuwi2.cjs +1 -0
  89. package/dist/{is-root-dir.d.ts → is-root-dir-CQA1qNI-.d.mts} +5 -1
  90. package/dist/is-root-dir-CQA1qNI-.d.mts.map +1 -0
  91. package/dist/is-root-dir-DI5qcnLw.mjs +2 -0
  92. package/dist/is-root-dir-DI5qcnLw.mjs.map +1 -0
  93. package/dist/is-root-dir-DnWZlIgB.d.cts +11 -0
  94. package/dist/is-root-dir-DnWZlIgB.d.cts.map +1 -0
  95. package/dist/is-root-dir.cjs +1 -9
  96. package/dist/is-root-dir.d.cts +2 -0
  97. package/dist/is-root-dir.d.mts +2 -0
  98. package/dist/is-root-dir.mjs +1 -1
  99. package/dist/is-type.cjs +1 -31
  100. package/dist/{is-type.d.ts → is-type.d.cts} +10 -6
  101. package/dist/is-type.d.cts.map +1 -0
  102. package/dist/is-type.d.mts +72 -0
  103. package/dist/is-type.d.mts.map +1 -0
  104. package/dist/is-type.mjs +1 -1
  105. package/dist/join-paths-BLjJ0GmK.mjs +2 -0
  106. package/dist/join-paths-BLjJ0GmK.mjs.map +1 -0
  107. package/dist/{join-paths.d.ts → join-paths-Bklwf_Bh.d.mts} +6 -2
  108. package/dist/join-paths-Bklwf_Bh.d.mts.map +1 -0
  109. package/dist/join-paths-DBTcCEw0.d.cts +13 -0
  110. package/dist/join-paths-DBTcCEw0.d.cts.map +1 -0
  111. package/dist/join-paths-hCBPtGlC.cjs +1 -0
  112. package/dist/join-paths.cjs +1 -60
  113. package/dist/join-paths.d.cts +2 -0
  114. package/dist/join-paths.d.mts +2 -0
  115. package/dist/join-paths.mjs +1 -1
  116. package/dist/join.cjs +1 -16
  117. package/dist/join.d.cts +2 -0
  118. package/dist/join.d.mts +2 -0
  119. package/dist/join.mjs +1 -1
  120. package/dist/normalize.cjs +1 -16
  121. package/dist/normalize.d.cts +2 -0
  122. package/dist/normalize.d.mts +2 -0
  123. package/dist/normalize.mjs +1 -1
  124. package/dist/regex-BEjSq2wo.cjs +1 -0
  125. package/dist/regex-DHvK8l1E.d.cts +12 -0
  126. package/dist/regex-DHvK8l1E.d.cts.map +1 -0
  127. package/dist/regex-fq9t8ABF.d.mts +12 -0
  128. package/dist/regex-fq9t8ABF.d.mts.map +1 -0
  129. package/dist/regex-hMUNHeGK.mjs +2 -0
  130. package/dist/regex-hMUNHeGK.mjs.map +1 -0
  131. package/dist/regex.cjs +1 -14
  132. package/dist/regex.d.cts +2 -0
  133. package/dist/regex.d.mts +2 -0
  134. package/dist/regex.mjs +1 -1
  135. package/dist/{replace.d.ts → replace-0nP9MPWp.d.cts} +6 -2
  136. package/dist/replace-0nP9MPWp.d.cts.map +1 -0
  137. package/dist/replace-C570sho0.cjs +1 -0
  138. package/dist/replace-C9dh7bEG.mjs +2 -0
  139. package/dist/replace-C9dh7bEG.mjs.map +1 -0
  140. package/dist/replace-fEEM12P3.d.mts +34 -0
  141. package/dist/replace-fEEM12P3.d.mts.map +1 -0
  142. package/dist/replace.cjs +1 -17
  143. package/dist/replace.d.cts +2 -0
  144. package/dist/replace.d.mts +2 -0
  145. package/dist/replace.mjs +1 -1
  146. package/dist/resolve-parent-path-5B4YvR_k.mjs +2 -0
  147. package/dist/resolve-parent-path-5B4YvR_k.mjs.map +1 -0
  148. package/dist/resolve-parent-path-D5uwbjqj.d.mts +12 -0
  149. package/dist/resolve-parent-path-D5uwbjqj.d.mts.map +1 -0
  150. package/dist/resolve-parent-path-DIrSH2oN.cjs +1 -0
  151. package/dist/resolve-parent-path-oZQZf2nw.d.cts +12 -0
  152. package/dist/resolve-parent-path-oZQZf2nw.d.cts.map +1 -0
  153. package/dist/resolve-parent-path.cjs +1 -13
  154. package/dist/resolve-parent-path.d.cts +2 -0
  155. package/dist/resolve-parent-path.d.mts +2 -0
  156. package/dist/resolve-parent-path.mjs +1 -1
  157. package/dist/slash-C7xRDucF.mjs +2 -0
  158. package/dist/slash-C7xRDucF.mjs.map +1 -0
  159. package/dist/{slash.d.ts → slash-CuA7ERRf.d.mts} +6 -2
  160. package/dist/slash-CuA7ERRf.d.mts.map +1 -0
  161. package/dist/slash-DPd6cWOz.d.cts +18 -0
  162. package/dist/slash-DPd6cWOz.d.cts.map +1 -0
  163. package/dist/slash-DhzW1Om-.cjs +1 -0
  164. package/dist/slash.cjs +1 -15
  165. package/dist/slash.d.cts +2 -0
  166. package/dist/slash.d.mts +2 -0
  167. package/dist/slash.mjs +1 -1
  168. package/package.json +55 -258
  169. package/dist/delimiter.d.ts +0 -18
  170. package/dist/find.d.ts +0 -1
  171. package/dist/index.d.ts +0 -21
  172. package/dist/join.d.ts +0 -1
  173. package/dist/normalize.d.ts +0 -1
  174. package/dist/regex.d.ts +0 -8
  175. package/dist/resolve-parent-path.d.ts +0 -8
package/dist/cwd.d.cts ADDED
@@ -0,0 +1,2 @@
1
+ import { t as cwd } from "./cwd-Bt4NcS-v.cjs";
2
+ export { cwd };
package/dist/cwd.d.mts ADDED
@@ -0,0 +1,2 @@
1
+ import { t as cwd } from "./cwd-Dx53cgUn.mjs";
2
+ export { cwd };
package/dist/cwd.mjs CHANGED
@@ -1 +1 @@
1
- export function cwd(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}
1
+ import{t as e}from"./cwd-DxrPG9WB.mjs";export{e as cwd};
@@ -0,0 +1,2 @@
1
+ const e=(()=>process?.platform===`win32`?`;`:`:`)(),t={posix:void 0,win32:void 0},n=(n=e)=>new Proxy({},{get(e,a){return a===`delimiter`?n:a===`posix`?r:a===`win32`?i:t[a]}}),r=n(`:`),i=n(`;`);export{r as n,i as r,e as t};
2
+ //# sourceMappingURL=delimiter-B3nWo9Xn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delimiter-B3nWo9Xn.mjs","names":["delimiter: \";\" | \":\""],"sources":["../src/delimiter.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\n/**\n * The platform-specific file delimiter.\n *\n * Equals to `\";\"` in windows and `\":\"` in all other platforms.\n */\nexport const delimiter: \";\" | \":\" = /* @__PURE__ */ (() =>\n process?.platform === \"win32\" ? \";\" : \":\")();\n\n// Mix namespaces without side-effects of object to allow tree-shaking\n\nconst platforms = {\n posix: undefined,\n win32: undefined\n} as unknown as {\n posix: any;\n win32: any;\n};\n\nconst mix = (del: \";\" | \":\" = delimiter) => {\n return new Proxy(\n {},\n {\n get(_, prop) {\n if (prop === \"delimiter\") {\n return del;\n }\n if (prop === \"posix\") {\n // eslint-disable-next-line ts/no-use-before-define\n return posix;\n }\n if (prop === \"win32\") {\n // eslint-disable-next-line ts/no-use-before-define\n return win32;\n }\n return platforms[prop as keyof typeof platforms];\n }\n }\n ) as unknown as typeof platforms & { delimiter: typeof del };\n};\n\nexport const posix = /* @__PURE__ */ mix(\":\");\n\nexport const win32 = /* @__PURE__ */ mix(\";\");\n"],"mappings":"AAuBA,MAAaA,OACX,SAAS,WAAa,QAAU,IAAM,MAAM,CAIxC,EAAY,CAChB,MAAO,IAAA,GACP,MAAO,IAAA,GACR,CAKK,GAAO,EAAiB,IACrB,IAAI,MACT,EAAE,CACF,CACE,IAAI,EAAG,EAAM,CAYX,OAXI,IAAS,YACJ,EAEL,IAAS,QAEJ,EAEL,IAAS,QAEJ,EAEF,EAAU,IAEpB,CACF,CAGU,EAAwB,EAAI,IAAI,CAEhC,EAAwB,EAAI,IAAI"}
@@ -0,0 +1,22 @@
1
+ //#region src/delimiter.d.ts
2
+ /**
3
+ * The platform-specific file delimiter.
4
+ *
5
+ * Equals to `";"` in windows and `":"` in all other platforms.
6
+ */
7
+ declare const delimiter: ";" | ":";
8
+ declare const posix: {
9
+ posix: any;
10
+ win32: any;
11
+ } & {
12
+ delimiter: ";" | ":";
13
+ };
14
+ declare const win32: {
15
+ posix: any;
16
+ win32: any;
17
+ } & {
18
+ delimiter: ";" | ":";
19
+ };
20
+ //#endregion
21
+ export { posix as n, win32 as r, delimiter as t };
22
+ //# sourceMappingURL=delimiter-BwyCEwu9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delimiter-BwyCEwu9.d.cts","names":[],"sources":["../src/delimiter.ts"],"sourcesContent":[],"mappings":";;AAuBA;AAmCA;AAEA;;cArCa;cAmCA;;;;;;cAEA"}
@@ -0,0 +1,22 @@
1
+ //#region src/delimiter.d.ts
2
+ /**
3
+ * The platform-specific file delimiter.
4
+ *
5
+ * Equals to `";"` in windows and `":"` in all other platforms.
6
+ */
7
+ declare const delimiter: ";" | ":";
8
+ declare const posix: {
9
+ posix: any;
10
+ win32: any;
11
+ } & {
12
+ delimiter: ";" | ":";
13
+ };
14
+ declare const win32: {
15
+ posix: any;
16
+ win32: any;
17
+ } & {
18
+ delimiter: ";" | ":";
19
+ };
20
+ //#endregion
21
+ export { posix as n, win32 as r, delimiter as t };
22
+ //# sourceMappingURL=delimiter-DuDX7fvN.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delimiter-DuDX7fvN.d.mts","names":[],"sources":["../src/delimiter.ts"],"sourcesContent":[],"mappings":";;AAuBA;AAmCA;AAEA;;cArCa;cAmCA;;;;;;cAEA"}
@@ -0,0 +1 @@
1
+ const e=(()=>process?.platform===`win32`?`;`:`:`)(),t={posix:void 0,win32:void 0},n=(n=e)=>new Proxy({},{get(e,a){return a===`delimiter`?n:a===`posix`?r:a===`win32`?i:t[a]}}),r=n(`:`),i=n(`;`);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
@@ -1,18 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.win32 = exports.posix = exports.delimiter = void 0;
7
- const delimiter = exports.delimiter = process?.platform === "win32" ? ";" : ":";
8
- const i = {
9
- posix: void 0,
10
- win32: void 0
11
- },
12
- e = (t = delimiter) => new Proxy({}, {
13
- get(o, n) {
14
- return n === "delimiter" ? t : n === "posix" ? posix : n === "win32" ? win32 : i[n];
15
- }
16
- });
17
- const posix = exports.posix = e(":"),
18
- win32 = exports.win32 = e(";");
1
+ const e=require(`./delimiter-IA9U4fxC.cjs`);exports.delimiter=e.t,exports.posix=e.n,exports.win32=e.r;
@@ -0,0 +1,2 @@
1
+ import { n as posix, r as win32, t as delimiter } from "./delimiter-BwyCEwu9.cjs";
2
+ export { delimiter, posix, win32 };
@@ -0,0 +1,2 @@
1
+ import { n as posix, r as win32, t as delimiter } from "./delimiter-DuDX7fvN.mjs";
2
+ export { delimiter, posix, win32 };
@@ -1 +1 @@
1
- export const delimiter=process?.platform==="win32"?";":":";const i={posix:void 0,win32:void 0},e=(t=delimiter)=>new Proxy({},{get(o,n){return n==="delimiter"?t:n==="posix"?posix:n==="win32"?win32:i[n]}});export const posix=e(":"),win32=e(";");
1
+ import{n as e,r as t,t as n}from"./delimiter-B3nWo9Xn.mjs";export{n as delimiter,e as posix,t as win32};
@@ -0,0 +1 @@
1
+ const e=require(`./cwd-D66SsPHE.cjs`),t=require(`./regex-BEjSq2wo.cjs`),n=require(`./slash-DhzW1Om-.cjs`),r=require(`./join-paths-hCBPtGlC.cjs`),i=require(`./correct-path-B0Y_kOkW.cjs`),a=e=>{try{return e===null}catch{return!1}},o=e=>e===void 0,s=e=>{try{return o(e)||a(e)}catch{return!1}},c=e=>{try{return!s(e)}catch{return!1}},l=e=>{try{return typeof e==`string`}catch{return!1}},u=e=>{try{return c(e)&&l(e)&&e.length>0}catch{return!1}},d=``;function f(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,a=i.r(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!a.includes(`.`)?``:r===!1&&a.includes(`.`)?a.replace(`.${_(a)??``}`,``)||``:a}function p(e,t={}){let n=i.r(e),r=n.replace(f(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}const m=p;function h(e,t){let n=p(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}const g=h;function _(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.i.exec(i.r(e));return n&&n.length>0&&u(n[0])?n[0].replace(`.`,``):void 0}const v=_;function y(e){let t=_(e);return t?`.${t}`:void 0}function b(e){return _(e)??``}function x(e){let t=_(e);return t?`.${t}`:``}function S(e){return!!f(e)}function C(e){return!!p(e)}function w(e){return!!h(e)}function T(e){return!!_(e)}function E(t,a=e.t()){let o=i.r(t).split(`/`),s=``,c=!1;for(let e=o.length-1;e>=-1&&!c;e--){let t=e>=0?o[e]:a;!t||t.length===0||(s=r.n(t,s),c=n.i(t))}return s=i.n(s,!c),c&&!n.i(s)?`/${s}`:s.length>0?s:`.`}function D(...t){t=t.map(e=>i.r(e));let r=``,a=!1;for(let i=t.length-1;i>=-1&&!a;i--){let o=i>=0?t[i]:e.t();!o||o.length===0||(r=`${o}/${r}`,a=n.r(o))}return r=i.n(r,!a),a&&!n.r(r)?`/${r}`:r.length>0?r:`.`}function O(...e){return E(r.n(...e.map(e=>i.r(e))))}function k(e,n){let r=D(e).replace(t.s,`$1`).split(`/`),i=D(n).replace(t.s,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function A(e,t,n=!1){return k(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}function j(t){return A(t,e.t())}function M(e){let t=/^[/\\]|^[a-z]:[/\\]/i.exec(e)?.[0]?.replace(/\\/g,`/`)||``,r=i.r(e),a=r.replace(/\/$/,``).split(`/`).slice(0,-1);a.length===1&&/^[A-Z]:$/i.test(a[0])&&(a[0]+=`/`);let o=h(r),s=a.join(`/`)||(n.i(e)?`/`:`.`),c=b(e);return{root:t,dir:s,base:o,ext:c,name:o.slice(0,o.length-c.length)}}function N(e,t){let n=M(e);return r.n(n.dir,t.includes(`.`)?t:t+n.ext)}Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return N}});
@@ -1,16 +1,17 @@
1
- export interface FindFileNameOptions {
2
- /**
3
- * Require the file extension to be present in the file name.
4
- *
5
- * @defaultValue false
6
- */
7
- requireExtension?: boolean;
8
- /**
9
- * Return the file extension as part of the full file name result.
10
- *
11
- * @defaultValue true
12
- */
13
- withExtension?: boolean;
1
+ //#region src/file-path-fns.d.ts
2
+ interface FindFileNameOptions {
3
+ /**
4
+ * Require the file extension to be present in the file name.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ requireExtension?: boolean;
9
+ /**
10
+ * Return the file extension as part of the full file name result.
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ withExtension?: boolean;
14
15
  }
15
16
  /**
16
17
  * Find the file name from a file path.
@@ -25,7 +26,7 @@ export interface FindFileNameOptions {
25
26
  * @param options - Options to control the file name extraction
26
27
  * @returns The file name
27
28
  */
28
- export declare function findFileName(filePath: string, options?: FindFileNameOptions): string;
29
+ declare function findFileName(filePath: string, options?: FindFileNameOptions): string;
29
30
  /**
30
31
  * Find the full file path's directories from a file path.
31
32
  *
@@ -39,10 +40,11 @@ export declare function findFileName(filePath: string, options?: FindFileNameOpt
39
40
  * ```
40
41
  *
41
42
  * @param filePath - The file path to process
43
+ * @param options - Options to control the file name extraction
42
44
  * @returns The full file path's directories
43
45
  */
44
- export declare function findFilePath(filePath: string): string;
45
- export declare const dirname: typeof findFilePath;
46
+ declare function findFilePath(filePath: string, options?: FindFileNameOptions): string;
47
+ declare const dirname: typeof findFilePath;
46
48
  /**
47
49
  * Find the top most folder containing the file from a file path.
48
50
  *
@@ -55,10 +57,11 @@ export declare const dirname: typeof findFilePath;
55
57
  * // folderPath = "Documents"
56
58
  *
57
59
  * @param filePath - The file path to process
60
+ * @param options - Options to control the file name extraction
58
61
  * @returns The folder containing the file
59
62
  */
60
- export declare function findFolderName(filePath: string): string;
61
- export declare const basename: typeof findFolderName;
63
+ declare function findFolderName(filePath: string, options?: FindFileNameOptions): string;
64
+ declare const basename: typeof findFolderName;
62
65
  /**
63
66
  * Find the file extension from a file path.
64
67
  *
@@ -77,8 +80,8 @@ export declare const basename: typeof findFolderName;
77
80
  * @param filePath - The file path to process
78
81
  * @returns The file extension or undefined if no extension is found
79
82
  */
80
- export declare function findFileExtension(filePath: string): string | undefined;
81
- export declare const extname: typeof findFileExtension;
83
+ declare function findFileExtension(filePath: string): string | undefined;
84
+ declare const extname: typeof findFileExtension;
82
85
  /**
83
86
  * Find the file extension including the `"."` character prefix from a file path.
84
87
  *
@@ -90,7 +93,7 @@ export declare const extname: typeof findFileExtension;
90
93
  * @param filePath - The file path to process
91
94
  * @returns The file extension (including the `"."` prefix) or undefined if no extension is found
92
95
  */
93
- export declare function findFileDotExtension(filePath: string): string | undefined;
96
+ declare function findFileDotExtension(filePath: string): string | undefined;
94
97
  /**
95
98
  * Find the file extension from a file path or an empty string.
96
99
  *
@@ -102,7 +105,7 @@ export declare function findFileDotExtension(filePath: string): string | undefin
102
105
  * @param filePath - The file path to process
103
106
  * @returns The file extension or an empty string if no extension is found
104
107
  */
105
- export declare function findFileExtensionSafe(filePath: string): string;
108
+ declare function findFileExtensionSafe(filePath: string): string;
106
109
  /**
107
110
  * Find the file extension including the `"."` character prefix from a file path or an empty string.
108
111
  *
@@ -114,35 +117,35 @@ export declare function findFileExtensionSafe(filePath: string): string;
114
117
  * @param filePath - The file path to process
115
118
  * @returns The file extension (including the `"."` prefix) or an empty string if no extension is found
116
119
  */
117
- export declare function findFileDotExtensionSafe(filePath: string): string;
120
+ declare function findFileDotExtensionSafe(filePath: string): string;
118
121
  /**
119
122
  * Check if a file path has a file name.
120
123
  *
121
124
  * @param filePath - The file path to process
122
125
  * @returns An indicator specifying if the file path has a file name
123
126
  */
124
- export declare function hasFileName(filePath: string): boolean;
127
+ declare function hasFileName(filePath: string): boolean;
125
128
  /**
126
129
  * Check if a file path has a file path.
127
130
  *
128
131
  * @param filePath - The file path to process
129
132
  * @returns An indicator specifying if the file path has a file path
130
133
  */
131
- export declare function hasFilePath(filePath: string): boolean;
134
+ declare function hasFilePath(filePath: string): boolean;
132
135
  /**
133
136
  * Check if a file path has a folder name.
134
137
  *
135
138
  * @param filePath - The file path to process
136
139
  * @returns An indicator specifying if the file path has a folder name
137
140
  */
138
- export declare function hasFolderName(filePath: string): boolean;
141
+ declare function hasFolderName(filePath: string): boolean;
139
142
  /**
140
143
  * Check if a file path has a file extension.
141
144
  *
142
145
  * @param filePath - The file path to process
143
146
  * @returns An indicator specifying if the file path has a file extension
144
147
  */
145
- export declare function hasFileExtension(filePath: string): boolean;
148
+ declare function hasFileExtension(filePath: string): boolean;
146
149
  /**
147
150
  * Resolve the file path to an absolute path.
148
151
  *
@@ -150,15 +153,15 @@ export declare function hasFileExtension(filePath: string): boolean;
150
153
  * @param cwd - The current working directory
151
154
  * @returns The resolved path
152
155
  */
153
- export declare function resolvePath(path: string, cwd?: string): string;
154
- export declare function resolve(...paths: string[]): string;
156
+ declare function resolvePath(path: string, cwd?: string): string;
157
+ declare function resolve(...paths: string[]): string;
155
158
  /**
156
159
  * Resolve the file path to an absolute path.
157
160
  *
158
161
  * @param paths - The paths to resolve
159
162
  * @returns The resolved path
160
163
  */
161
- export declare function resolvePaths(...paths: string[]): string;
164
+ declare function resolvePaths(...paths: string[]): string;
162
165
  /**
163
166
  * Get the relative path from one file to another.
164
167
  *
@@ -169,7 +172,7 @@ export declare function resolvePaths(...paths: string[]): string;
169
172
  * @param to - The target path to resolve relative to the base path
170
173
  * @returns The relative path from the base path to the target path
171
174
  */
172
- export declare function relative(from: string, to: string): string;
175
+ declare function relative(from: string, to: string): string;
173
176
  /**
174
177
  * Get the relative path from one file to another.
175
178
  *
@@ -181,26 +184,26 @@ export declare function relative(from: string, to: string): string;
181
184
  * @param withEndSlash - Whether to include a trailing slash at the end of the path
182
185
  * @returns The relative path from the base path to the target path
183
186
  */
184
- export declare function relativePath(from: string, to: string, withEndSlash?: boolean): string;
187
+ declare function relativePath(from: string, to: string, withEndSlash?: boolean): string;
185
188
  /**
186
189
  * Find the file path relative to the workspace root path.
187
190
  *
188
191
  * @param filePath - The file path to process
189
192
  * @returns The resolved file path
190
193
  */
191
- export declare function relativeToCurrentDir(filePath: string): string;
194
+ declare function relativeToCurrentDir(filePath: string): string;
192
195
  /**
193
196
  * Check if the path is a relative path.
194
197
  *
195
198
  * @param path - The path to check
196
199
  * @returns An indicator specifying if the path is a relative path
197
200
  */
198
- export declare function parsePath(path: string): {
199
- root: string;
200
- dir: string;
201
- base: string;
202
- ext: string;
203
- name: string;
201
+ declare function parsePath(path: string): {
202
+ root: string;
203
+ dir: string;
204
+ base: string;
205
+ ext: string;
206
+ name: string;
204
207
  };
205
208
  /**
206
209
  * Rename the file name with a new name.
@@ -209,4 +212,7 @@ export declare function parsePath(path: string): {
209
212
  * @param newFileName - The updated file name being processed
210
213
  * @returns The modified or unmodified file path.
211
214
  */
212
- export declare function renameFile(filePath: string, newFileName: string): string;
215
+ declare function renameFile(filePath: string, newFileName: string): string;
216
+ //#endregion
217
+ export { resolvePaths as C, resolvePath as S, relative as _, findFileDotExtension as a, renameFile as b, findFileExtensionSafe as c, findFolderName as d, hasFileExtension as f, parsePath as g, hasFolderName as h, extname as i, findFileName as l, hasFilePath as m, basename as n, findFileDotExtensionSafe as o, hasFileName as p, dirname as r, findFileExtension as s, FindFileNameOptions as t, findFilePath as u, relativePath as v, resolve as x, relativeToCurrentDir as y };
218
+ //# sourceMappingURL=file-path-fns-BKbfZRTB.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-path-fns-BKbfZRTB.d.mts","names":[],"sources":["../src/file-path-fns.ts"],"sourcesContent":[],"mappings":";UA0BiB,mBAAA;EAAA;AA6BjB;AAuCA;AAcA;AAiBA;EAyBa,gBAAyB,CAAA,EAAA,OAAjB;EAoBL;AAYhB;AAaA;AAiBA;AAeA;EAYgB,aAAA,CAAW,EAAA,OAAA;AAU3B;AAUA;AAUA;AAWA;AAoCA;AA0CA;AAgBA;AAsCA;AAaA;AAUA;AAgCA;;;;iBA5ZgB,YAAA,6BAEL;;;;;;;;;;;;;;;;;iBAqCK,YAAA,6BAEL;cAYE,gBAAO;;;;;;;;;;;;;;;;iBAiBJ,cAAA,6BAEJ;cAuBC,iBAAQ;;;;;;;;;;;;;;;;;;;iBAoBL,iBAAA;cAYH,gBAAO;;;;;;;;;;;;iBAaJ,oBAAA;;;;;;;;;;;;iBAiBA,qBAAA;;;;;;;;;;;;iBAeA,wBAAA;;;;;;;iBAYA,WAAA;;;;;;;iBAUA,WAAA;;;;;;;iBAUA,aAAA;;;;;;;iBAUA,gBAAA;;;;;;;;iBAWA,WAAA;iBAoCA,OAAA;;;;;;;iBA0CA,YAAA;;;;;;;;;;;iBAgBA,QAAA;;;;;;;;;;;;iBAsCA,YAAA;;;;;;;iBAaA,oBAAA;;;;;;;iBAUA,SAAA;;;;;;;;;;;;;;iBAgCA,UAAA"}
@@ -0,0 +1,218 @@
1
+ //#region src/file-path-fns.d.ts
2
+ interface FindFileNameOptions {
3
+ /**
4
+ * Require the file extension to be present in the file name.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ requireExtension?: boolean;
9
+ /**
10
+ * Return the file extension as part of the full file name result.
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ withExtension?: boolean;
15
+ }
16
+ /**
17
+ * Find the file name from a file path.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const fileName = findFileName("C:\\Users\\user\\Documents\\file.txt");
22
+ * // fileName = "file.txt"
23
+ * ```
24
+ *
25
+ * @param filePath - The file path to process
26
+ * @param options - Options to control the file name extraction
27
+ * @returns The file name
28
+ */
29
+ declare function findFileName(filePath: string, options?: FindFileNameOptions): string;
30
+ /**
31
+ * Find the full file path's directories from a file path.
32
+ *
33
+ * @remarks
34
+ * The functionality of this method is similar to the {@link path.dirname} function in Node's path module.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const folderPath = findFilePath("C:\\Users\\user\\Documents\\file.txt");
39
+ * // folderPath = "C:\\Users\\user\\Documents"
40
+ * ```
41
+ *
42
+ * @param filePath - The file path to process
43
+ * @param options - Options to control the file name extraction
44
+ * @returns The full file path's directories
45
+ */
46
+ declare function findFilePath(filePath: string, options?: FindFileNameOptions): string;
47
+ declare const dirname: typeof findFilePath;
48
+ /**
49
+ * Find the top most folder containing the file from a file path.
50
+ *
51
+ * @remarks
52
+ * The functionality of this method is similar to the {@link path.basename} function in Node's path module.
53
+ * If you're looking for the full path of the folder (for example: `C:\\Users\\user\\Documents` instead of just `Documents`) containing the file, use {@link findFilePath} instead.
54
+ *
55
+ * @example
56
+ * const folderPath = findFolderName("C:\\Users\\user\\Documents\\file.txt");
57
+ * // folderPath = "Documents"
58
+ *
59
+ * @param filePath - The file path to process
60
+ * @param options - Options to control the file name extraction
61
+ * @returns The folder containing the file
62
+ */
63
+ declare function findFolderName(filePath: string, options?: FindFileNameOptions): string;
64
+ declare const basename: typeof findFolderName;
65
+ /**
66
+ * Find the file extension from a file path.
67
+ *
68
+ * @remarks
69
+ * The functionality of this method is similar to the {@link path.extname} function in Node's path module.
70
+ * The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
71
+ *
72
+ * The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * findFileExtension("C:\\Users\\user\\Documents\\file.config.ts");
77
+ * // Returns "ts"
78
+ * ```
79
+ *
80
+ * @param filePath - The file path to process
81
+ * @returns The file extension or undefined if no extension is found
82
+ */
83
+ declare function findFileExtension(filePath: string): string | undefined;
84
+ declare const extname: typeof findFileExtension;
85
+ /**
86
+ * Find the file extension including the `"."` character prefix from a file path.
87
+ *
88
+ * @remarks
89
+ * The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
90
+ *
91
+ * The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.
92
+ *
93
+ * @param filePath - The file path to process
94
+ * @returns The file extension (including the `"."` prefix) or undefined if no extension is found
95
+ */
96
+ declare function findFileDotExtension(filePath: string): string | undefined;
97
+ /**
98
+ * Find the file extension from a file path or an empty string.
99
+ *
100
+ * @remarks
101
+ * The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
102
+ *
103
+ * The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.
104
+ *
105
+ * @param filePath - The file path to process
106
+ * @returns The file extension or an empty string if no extension is found
107
+ */
108
+ declare function findFileExtensionSafe(filePath: string): string;
109
+ /**
110
+ * Find the file extension including the `"."` character prefix from a file path or an empty string.
111
+ *
112
+ * @remarks
113
+ * The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
114
+ *
115
+ * The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.
116
+ *
117
+ * @param filePath - The file path to process
118
+ * @returns The file extension (including the `"."` prefix) or an empty string if no extension is found
119
+ */
120
+ declare function findFileDotExtensionSafe(filePath: string): string;
121
+ /**
122
+ * Check if a file path has a file name.
123
+ *
124
+ * @param filePath - The file path to process
125
+ * @returns An indicator specifying if the file path has a file name
126
+ */
127
+ declare function hasFileName(filePath: string): boolean;
128
+ /**
129
+ * Check if a file path has a file path.
130
+ *
131
+ * @param filePath - The file path to process
132
+ * @returns An indicator specifying if the file path has a file path
133
+ */
134
+ declare function hasFilePath(filePath: string): boolean;
135
+ /**
136
+ * Check if a file path has a folder name.
137
+ *
138
+ * @param filePath - The file path to process
139
+ * @returns An indicator specifying if the file path has a folder name
140
+ */
141
+ declare function hasFolderName(filePath: string): boolean;
142
+ /**
143
+ * Check if a file path has a file extension.
144
+ *
145
+ * @param filePath - The file path to process
146
+ * @returns An indicator specifying if the file path has a file extension
147
+ */
148
+ declare function hasFileExtension(filePath: string): boolean;
149
+ /**
150
+ * Resolve the file path to an absolute path.
151
+ *
152
+ * @param path - The path to resolve
153
+ * @param cwd - The current working directory
154
+ * @returns The resolved path
155
+ */
156
+ declare function resolvePath(path: string, cwd?: string): string;
157
+ declare function resolve(...paths: string[]): string;
158
+ /**
159
+ * Resolve the file path to an absolute path.
160
+ *
161
+ * @param paths - The paths to resolve
162
+ * @returns The resolved path
163
+ */
164
+ declare function resolvePaths(...paths: string[]): string;
165
+ /**
166
+ * Get the relative path from one file to another.
167
+ *
168
+ * @remarks
169
+ * This function is similar to the `path.relative` function in Node's path module.
170
+ *
171
+ * @param from - The base path to start from
172
+ * @param to - The target path to resolve relative to the base path
173
+ * @returns The relative path from the base path to the target path
174
+ */
175
+ declare function relative(from: string, to: string): string;
176
+ /**
177
+ * Get the relative path from one file to another.
178
+ *
179
+ * @remarks
180
+ * This function wraps the `path.relative` function in Node's path module.
181
+ *
182
+ * @param from - The base path to start from
183
+ * @param to - The target path to resolve relative to the base path
184
+ * @param withEndSlash - Whether to include a trailing slash at the end of the path
185
+ * @returns The relative path from the base path to the target path
186
+ */
187
+ declare function relativePath(from: string, to: string, withEndSlash?: boolean): string;
188
+ /**
189
+ * Find the file path relative to the workspace root path.
190
+ *
191
+ * @param filePath - The file path to process
192
+ * @returns The resolved file path
193
+ */
194
+ declare function relativeToCurrentDir(filePath: string): string;
195
+ /**
196
+ * Check if the path is a relative path.
197
+ *
198
+ * @param path - The path to check
199
+ * @returns An indicator specifying if the path is a relative path
200
+ */
201
+ declare function parsePath(path: string): {
202
+ root: string;
203
+ dir: string;
204
+ base: string;
205
+ ext: string;
206
+ name: string;
207
+ };
208
+ /**
209
+ * Rename the file name with a new name.
210
+ *
211
+ * @param filePath - The current file path being processed
212
+ * @param newFileName - The updated file name being processed
213
+ * @returns The modified or unmodified file path.
214
+ */
215
+ declare function renameFile(filePath: string, newFileName: string): string;
216
+ //#endregion
217
+ export { resolvePaths as C, resolvePath as S, relative as _, findFileDotExtension as a, renameFile as b, findFileExtensionSafe as c, findFolderName as d, hasFileExtension as f, parsePath as g, hasFolderName as h, extname as i, findFileName as l, hasFilePath as m, basename as n, findFileDotExtensionSafe as o, hasFileName as p, dirname as r, findFileExtension as s, FindFileNameOptions as t, findFilePath as u, relativePath as v, resolve as x, relativeToCurrentDir as y };
218
+ //# sourceMappingURL=file-path-fns-CTLJP4j9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-path-fns-CTLJP4j9.d.cts","names":[],"sources":["../src/file-path-fns.ts"],"sourcesContent":[],"mappings":";UA0BiB,mBAAA;EAAA;AA6BjB;AAuCA;AAcA;AAiBA;EAyBa,gBAAyB,CAAA,EAAA,OAAjB;EAoBL;AAYhB;AAaA;AAiBA;AAeA;EAYgB,aAAA,CAAW,EAAA,OAAA;AAU3B;AAUA;AAUA;AAWA;AAoCA;AA0CA;AAgBA;AAsCA;AAaA;AAUA;AAgCA;;;;iBA5ZgB,YAAA,6BAEL;;;;;;;;;;;;;;;;;iBAqCK,YAAA,6BAEL;cAYE,gBAAO;;;;;;;;;;;;;;;;iBAiBJ,cAAA,6BAEJ;cAuBC,iBAAQ;;;;;;;;;;;;;;;;;;;iBAoBL,iBAAA;cAYH,gBAAO;;;;;;;;;;;;iBAaJ,oBAAA;;;;;;;;;;;;iBAiBA,qBAAA;;;;;;;;;;;;iBAeA,wBAAA;;;;;;;iBAYA,WAAA;;;;;;;iBAUA,WAAA;;;;;;;iBAUA,aAAA;;;;;;;iBAUA,gBAAA;;;;;;;;iBAWA,WAAA;iBAoCA,OAAA;;;;;;;iBA0CA,YAAA;;;;;;;;;;;iBAgBA,QAAA;;;;;;;;;;;;iBAsCA,YAAA;;;;;;;iBAaA,oBAAA;;;;;;;iBAUA,SAAA;;;;;;;;;;;;;;iBAgCA,UAAA"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cwd-DxrPG9WB.mjs";import{i as t,s as n}from"./regex-hMUNHeGK.mjs";import{i as r,r as i}from"./slash-C7xRDucF.mjs";import{n as a}from"./join-paths-BLjJ0GmK.mjs";import{n as o,r as s}from"./correct-path-DmaZHNUF.mjs";const c=e=>{try{return e===null}catch{return!1}},l=e=>e===void 0,u=e=>{try{return l(e)||c(e)}catch{return!1}},d=e=>{try{return!u(e)}catch{return!1}},f=e=>{try{return typeof e==`string`}catch{return!1}},p=e=>{try{return d(e)&&f(e)&&e.length>0}catch{return!1}};function m(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=s(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${y(i)??``}`,``)||``:i}function h(e,t={}){let n=s(e),r=n.replace(m(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}const g=h;function _(e,t){let n=h(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}const v=_;function y(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.exec(s(e));return n&&n.length>0&&p(n[0])?n[0].replace(`.`,``):void 0}const b=y;function x(e){let t=y(e);return t?`.${t}`:void 0}function S(e){return y(e)??``}function C(e){let t=y(e);return t?`.${t}`:``}function w(e){return!!m(e)}function T(e){return!!h(e)}function E(e){return!!_(e)}function D(e){return!!y(e)}function O(t,n=e()){let i=s(t).split(`/`),c=``,l=!1;for(let e=i.length-1;e>=-1&&!l;e--){let t=e>=0?i[e]:n;!t||t.length===0||(c=a(t,c),l=r(t))}return c=o(c,!l),l&&!r(c)?`/${c}`:c.length>0?c:`.`}function k(...t){t=t.map(e=>s(e));let n=``,r=!1;for(let a=t.length-1;a>=-1&&!r;a--){let o=a>=0?t[a]:e();!o||o.length===0||(n=`${o}/${n}`,r=i(o))}return n=o(n,!r),r&&!i(n)?`/${n}`:n.length>0?n:`.`}function A(...e){return O(a(...e.map(e=>s(e))))}function j(e,t){let r=k(e).replace(n,`$1`).split(`/`),i=k(t).replace(n,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function M(e,t,n=!1){return j(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}function N(t){return M(t,e())}function P(e){let t=/^[/\\]|^[a-z]:[/\\]/i.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=s(e),i=n.replace(/\/$/,``).split(`/`).slice(0,-1);i.length===1&&/^[A-Z]:$/i.test(i[0])&&(i[0]+=`/`);let a=_(n),o=i.join(`/`)||(r(e)?`/`:`.`),c=S(e);return{root:t,dir:o,base:a,ext:c,name:a.slice(0,a.length-c.length)}}function F(e,t){let n=P(e);return a(n.dir,t.includes(`.`)?t:t+n.ext)}export{A as S,M as _,C as a,k as b,m as c,D as d,w as f,j as g,P as h,x as i,h as l,E as m,g as n,y as o,T as p,b as r,S as s,v as t,_ as u,N as v,O as x,F as y};
2
+ //# sourceMappingURL=file-path-fns-MRI3PV8K.mjs.map