@stryke/path 0.22.0 → 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} +44 -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 -151
  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
@@ -1,7 +1,11 @@
1
+ //#region src/is-root-dir.d.ts
1
2
  /**
2
3
  * Check if the directory is the current system's root directory.
3
4
  *
4
5
  * @param dir - The directory to check.
5
6
  * @returns Returns true if the directory is the root directory.
6
7
  */
7
- export declare function isSystemRoot(dir: string): boolean;
8
+ declare function isSystemRoot(dir: string): boolean;
9
+ //#endregion
10
+ export { isSystemRoot as t };
11
+ //# sourceMappingURL=is-root-dir-CQA1qNI-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-root-dir-CQA1qNI-.d.mts","names":[],"sources":["../src/is-root-dir.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;iBAAgB,YAAA"}
@@ -0,0 +1,2 @@
1
+ function e(e){return e===`/`||e===`c:\\`||e===`C:\\`}export{e as t};
2
+ //# sourceMappingURL=is-root-dir-DI5qcnLw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-root-dir-DI5qcnLw.mjs","names":[],"sources":["../src/is-root-dir.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 * Check if the directory is the current system's root directory.\n *\n * @param dir - The directory to check.\n * @returns Returns true if the directory is the root directory.\n */\nexport function isSystemRoot(dir: string): boolean {\n return Boolean(dir === \"/\" || dir === \"c:\\\\\" || dir === \"C:\\\\\");\n}\n"],"mappings":"AAwBA,SAAgB,EAAa,EAAsB,CACjD,OAAe,IAAQ,KAAO,IAAQ,QAAU,IAAQ"}
@@ -0,0 +1,11 @@
1
+ //#region src/is-root-dir.d.ts
2
+ /**
3
+ * Check if the directory is the current system's root directory.
4
+ *
5
+ * @param dir - The directory to check.
6
+ * @returns Returns true if the directory is the root directory.
7
+ */
8
+ declare function isSystemRoot(dir: string): boolean;
9
+ //#endregion
10
+ export { isSystemRoot as t };
11
+ //# sourceMappingURL=is-root-dir-DnWZlIgB.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-root-dir-DnWZlIgB.d.cts","names":[],"sources":["../src/is-root-dir.ts"],"sourcesContent":[],"mappings":";;AAwBA;;;;;iBAAgB,YAAA"}
@@ -1,9 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isSystemRoot = isSystemRoot;
7
- function isSystemRoot(o) {
8
- return o === "/" || o === "c:\\" || o === "C:\\";
9
- }
1
+ const e=require(`./is-root-dir-BzQKuwi2.cjs`);exports.isSystemRoot=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as isSystemRoot } from "./is-root-dir-DnWZlIgB.cjs";
2
+ export { isSystemRoot };
@@ -0,0 +1,2 @@
1
+ import { t as isSystemRoot } from "./is-root-dir-CQA1qNI-.mjs";
2
+ export { isSystemRoot };
@@ -1 +1 @@
1
- export function isSystemRoot(o){return o==="/"||o==="c:\\"||o==="C:\\"}
1
+ import{t as e}from"./is-root-dir-DI5qcnLw.mjs";export{e as isSystemRoot};
package/dist/is-type.cjs CHANGED
@@ -1,31 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isAbsolute = isAbsolute;
7
- exports.isAbsolutePath = isAbsolutePath;
8
- exports.isNpmScopedPackage = isNpmScopedPackage;
9
- exports.isNpmScopedPackagePath = isNpmScopedPackagePath;
10
- exports.isRelative = isRelative;
11
- exports.isRelativePath = isRelativePath;
12
- var _regex = require("./regex.cjs");
13
- var _slash = require("./slash.cjs");
14
- function isAbsolutePath(t) {
15
- return _regex.ABSOLUTE_PATH_REGEX.test((0, _slash.slash)(t));
16
- }
17
- function isAbsolute(t) {
18
- return isAbsolutePath(t);
19
- }
20
- function isRelativePath(t) {
21
- return !isAbsolutePath(t);
22
- }
23
- function isRelative(t) {
24
- return isRelativePath(t);
25
- }
26
- function isNpmScopedPackagePath(t) {
27
- return _regex.NPM_SCOPED_PACKAGE_REGEX.test((0, _slash.slash)(t));
28
- }
29
- function isNpmScopedPackage(t) {
30
- return isNpmScopedPackagePath(t);
31
- }
1
+ const e=require(`./slash-DhzW1Om-.cjs`);exports.isAbsolute=e.r,exports.isAbsolutePath=e.i,exports.isNpmScopedPackage=e.a,exports.isNpmScopedPackagePath=e.o,exports.isRelative=e.s,exports.isRelativePath=e.c;
@@ -1,10 +1,11 @@
1
+ //#region src/is-type.d.ts
1
2
  /**
2
3
  * Check if the path is an absolute path.
3
4
  *
4
5
  * @param path - The path to check
5
6
  * @returns An indicator specifying if the path is an absolute path
6
7
  */
7
- export declare function isAbsolutePath(path: string): boolean;
8
+ declare function isAbsolutePath(path: string): boolean;
8
9
  /**
9
10
  * Check if the path is an absolute path.
10
11
  *
@@ -14,14 +15,14 @@ export declare function isAbsolutePath(path: string): boolean;
14
15
  * @param path - The path to check
15
16
  * @returns An indicator specifying if the path is an absolute path
16
17
  */
17
- export declare function isAbsolute(path: string): boolean;
18
+ declare function isAbsolute(path: string): boolean;
18
19
  /**
19
20
  * Check if the path is a relative path.
20
21
  *
21
22
  * @param path - The path to check
22
23
  * @returns An indicator specifying if the path is a relative path
23
24
  */
24
- export declare function isRelativePath(path: string): boolean;
25
+ declare function isRelativePath(path: string): boolean;
25
26
  /**
26
27
  * Check if the path is a relative path.
27
28
  *
@@ -31,7 +32,7 @@ export declare function isRelativePath(path: string): boolean;
31
32
  * @param path - The path to check
32
33
  * @returns An indicator specifying if the path is a relative path
33
34
  */
34
- export declare function isRelative(path: string): boolean;
35
+ declare function isRelative(path: string): boolean;
35
36
  /**
36
37
  * Check if the path is a npm package path.
37
38
  *
@@ -48,7 +49,7 @@ export declare function isRelative(path: string): boolean;
48
49
  * @param path - The path to check
49
50
  * @returns An indicator specifying if the path is a npm package path
50
51
  */
51
- export declare function isNpmScopedPackagePath(path: string): boolean;
52
+ declare function isNpmScopedPackagePath(path: string): boolean;
52
53
  /**
53
54
  * Check if the path is a npm package path.
54
55
  *
@@ -65,4 +66,7 @@ export declare function isNpmScopedPackagePath(path: string): boolean;
65
66
  * @param path - The path to check
66
67
  * @returns An indicator specifying if the path is a npm package path
67
68
  */
68
- export declare function isNpmScopedPackage(path: string): boolean;
69
+ declare function isNpmScopedPackage(path: string): boolean;
70
+ //#endregion
71
+ export { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };
72
+ //# sourceMappingURL=is-type.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-type.d.cts","names":[],"sources":["../src/is-type.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAaA;AAUA;AAaA;AAoBA;AAoBgB,iBA5EA,cAAA,CA4EkB,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;;;;;;iBA/DlB,UAAA;;;;;;;iBAUA,cAAA;;;;;;;;;;iBAaA,UAAA;;;;;;;;;;;;;;;;;iBAoBA,sBAAA;;;;;;;;;;;;;;;;;iBAoBA,kBAAA"}
@@ -0,0 +1,72 @@
1
+ //#region src/is-type.d.ts
2
+ /**
3
+ * Check if the path is an absolute path.
4
+ *
5
+ * @param path - The path to check
6
+ * @returns An indicator specifying if the path is an absolute path
7
+ */
8
+ declare function isAbsolutePath(path: string): boolean;
9
+ /**
10
+ * Check if the path is an absolute path.
11
+ *
12
+ * @remarks
13
+ * This is an alias for {@link isAbsolutePath}.
14
+ *
15
+ * @param path - The path to check
16
+ * @returns An indicator specifying if the path is an absolute path
17
+ */
18
+ declare function isAbsolute(path: string): boolean;
19
+ /**
20
+ * Check if the path is a relative path.
21
+ *
22
+ * @param path - The path to check
23
+ * @returns An indicator specifying if the path is a relative path
24
+ */
25
+ declare function isRelativePath(path: string): boolean;
26
+ /**
27
+ * Check if the path is a relative path.
28
+ *
29
+ * @remarks
30
+ * This is an alias for {@link isRelativePath}.
31
+ *
32
+ * @param path - The path to check
33
+ * @returns An indicator specifying if the path is a relative path
34
+ */
35
+ declare function isRelative(path: string): boolean;
36
+ /**
37
+ * Check if the path is a npm package path.
38
+ *
39
+ * @remarks
40
+ * This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * isNpmScopedPackage("@stryke/path"); // returns true
45
+ * isNpmScopedPackage("lodash"); // returns false
46
+ * isNpmNamespacePackage("./src/index.ts"); // returns false
47
+ * ```
48
+ *
49
+ * @param path - The path to check
50
+ * @returns An indicator specifying if the path is a npm package path
51
+ */
52
+ declare function isNpmScopedPackagePath(path: string): boolean;
53
+ /**
54
+ * Check if the path is a npm package path.
55
+ *
56
+ * @remarks
57
+ * This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * isNpmScopedPackagePath("@stryke/path"); // returns true
62
+ * isNpmScopedPackagePath("lodash"); // returns false
63
+ * isNpmScopedPackagePath("./src/index.ts"); // returns false
64
+ * ```
65
+ *
66
+ * @param path - The path to check
67
+ * @returns An indicator specifying if the path is a npm package path
68
+ */
69
+ declare function isNpmScopedPackage(path: string): boolean;
70
+ //#endregion
71
+ export { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };
72
+ //# sourceMappingURL=is-type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-type.d.mts","names":[],"sources":["../src/is-type.ts"],"sourcesContent":[],"mappings":";;AA2BA;AAaA;AAUA;AAaA;AAoBA;AAoBgB,iBA5EA,cAAA,CA4EkB,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;;;;;;iBA/DlB,UAAA;;;;;;;iBAUA,cAAA;;;;;;;;;;iBAaA,UAAA;;;;;;;;;;;;;;;;;iBAoBA,sBAAA;;;;;;;;;;;;;;;;;iBAoBA,kBAAA"}
package/dist/is-type.mjs CHANGED
@@ -1 +1 @@
1
- import{ABSOLUTE_PATH_REGEX as e,NPM_SCOPED_PACKAGE_REGEX as n}from"./regex";import{slash as o}from"./slash";export function isAbsolutePath(t){return e.test(o(t))}export function isAbsolute(t){return isAbsolutePath(t)}export function isRelativePath(t){return!isAbsolutePath(t)}export function isRelative(t){return isRelativePath(t)}export function isNpmScopedPackagePath(t){return n.test(o(t))}export function isNpmScopedPackage(t){return isNpmScopedPackagePath(t)}
1
+ import{a as e,c as t,i as n,o as r,r as i,s as a}from"./slash-C7xRDucF.mjs";export{i as isAbsolute,n as isAbsolutePath,e as isNpmScopedPackage,r as isNpmScopedPackagePath,a as isRelative,t as isRelativePath};
@@ -0,0 +1,2 @@
1
+ import{c as e,n as t,r as n}from"./regex-hMUNHeGK.mjs";import{r}from"./slash-C7xRDucF.mjs";function i(e=``){return e&&e.replace(/\\/g,`/`).replace(n,e=>e.toUpperCase())}function a(n){if(!n||n.length===0)return`.`;n=i(n);let a=n.match(e),o=r(n),s=n[n.length-1]===`/`;return n=c(n,!o),n.length===0?o?`/`:s?`./`:`.`:(s&&(n+=`/`),t.test(n)&&(n+=`/`),a?o?`//${n}`:`//./${n}`:o&&!r(n)?`/${n}`:n)}function o(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return a(t)}const s=o;function c(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}export{o as n,s as t};
2
+ //# sourceMappingURL=join-paths-BLjJ0GmK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths-BLjJ0GmK.mjs","names":["char: string | null"],"sources":["../src/join-paths.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 { isAbsolute } from \"./is-type\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\n\n// Util to normalize windows paths to posix\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input\n .replace(/\\\\/g, \"/\")\n .replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\nfunction correctPaths(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 = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\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 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 isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n\n/**\n * Joins all given path segments together using the platform-specific separator as a delimiter.\n * The resulting path is normalized to remove any redundant or unnecessary segments.\n *\n * @param segments - The path segments to join.\n * @returns The joined and normalized path string.\n */\nexport function joinPaths(...segments: string[]): string {\n let path = \"\";\n\n for (const seg of segments) {\n if (!seg) {\n continue;\n }\n if (path.length > 0) {\n const pathTrailing = path[path.length - 1] === \"/\";\n const segLeading = seg[0] === \"/\";\n const both = pathTrailing && segLeading;\n if (both) {\n path += seg.slice(1);\n } else {\n path += pathTrailing || segLeading ? seg : `/${seg}`;\n }\n } else {\n path += seg;\n }\n }\n\n return correctPaths(path);\n}\n\nexport const join = joinPaths;\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 normalized path string.\n */\nfunction 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"],"mappings":"2FA0BA,SAAS,EAAqB,EAAQ,GAAI,CAIxC,OAHK,GAGE,EACJ,QAAQ,MAAO,IAAI,CACnB,QAAQ,EAA0B,GAAK,EAAE,aAAa,CAAC,CAG5D,SAAS,EAAa,EAAe,CACnC,GAAI,CAAC,GAAQ,EAAK,SAAW,EAC3B,MAAO,IAIT,EAAO,EAAqB,EAAK,CAEjC,IAAM,EAAY,EAAK,MAAM,EAAU,CACjC,EAAiB,EAAW,EAAK,CACjC,EAAoB,EAAK,EAAK,OAAS,KAAO,IAyBpD,MAtBA,GAAO,EAAgB,EAAM,CAAC,EAAe,CAEzC,EAAK,SAAW,EACd,EACK,IAEF,EAAoB,KAAO,KAEhC,IACF,GAAQ,KAEN,EAAmB,KAAK,EAAK,GAC/B,GAAQ,KAGN,EACG,EAGE,KAAK,IAFH,OAAO,IAKX,GAAkB,CAAC,EAAW,EAAK,CAAG,IAAI,IAAS,GAU5D,SAAgB,EAAU,GAAG,EAA4B,CACvD,IAAI,EAAO,GAEX,IAAK,IAAM,KAAO,EACX,KAGL,GAAI,EAAK,OAAS,EAAG,CACnB,IAAM,EAAe,EAAK,EAAK,OAAS,KAAO,IACzC,EAAa,EAAI,KAAO,IACjB,GAAgB,EAE3B,GAAQ,EAAI,MAAM,EAAE,CAEpB,GAAQ,GAAgB,EAAa,EAAM,IAAI,SAGjD,GAAQ,EAIZ,OAAO,EAAa,EAAK,CAG3B,MAAa,EAAO,EASpB,SAAS,EAAgB,EAAc,EAAyB,CAC9D,IAAI,EAAM,GACN,EAAoB,EACpB,EAAY,GACZ,EAAO,EACPA,EAAsB,KAC1B,IAAK,IAAI,EAAQ,EAAG,GAAS,EAAK,OAAQ,EAAE,EAAO,CACjD,GAAI,EAAQ,EAAK,OAEf,EAAO,EAAK,WACH,IAAS,IAClB,WAEA,EAAO,IAET,GAAI,IAAS,IAAK,CAChB,GAAI,MAAc,EAAQ,GAAK,IAAS,GAAG,GAEhC,IAAS,EAAG,CACrB,GACE,EAAI,OAAS,GACb,IAAsB,GACtB,EAAI,EAAI,OAAS,KAAO,KACxB,EAAI,EAAI,OAAS,KAAO,QAEpB,EAAI,OAAS,EAAG,CAClB,IAAM,EAAiB,EAAI,YAAY,IAAI,CACvC,IAAmB,IACrB,EAAM,GACN,EAAoB,IAEpB,EAAM,EAAI,MAAM,EAAG,EAAe,CAClC,EAAoB,EAAI,OAAS,EAAI,EAAI,YAAY,IAAI,EAE3D,EAAY,EACZ,EAAO,EACP,iBACS,EAAI,OAAS,EAAG,CACzB,EAAM,GACN,EAAoB,EACpB,EAAY,EACZ,EAAO,EACP,UAGA,IACF,GAAO,EAAI,OAAS,EAAI,MAAQ,KAChC,EAAoB,QAGlB,EAAI,OAAS,EACf,GAAO,IAAI,EAAK,MAAM,EAAY,EAAG,EAAM,GAE3C,EAAM,EAAK,MAAM,EAAY,EAAG,EAAM,CAExC,EAAoB,EAAQ,EAAY,EAE1C,EAAY,EACZ,EAAO,OACE,IAAS,KAAO,IAAS,GAClC,EAAE,EAEF,EAAO,GAGX,OAAO"}
@@ -1,3 +1,4 @@
1
+ //#region src/join-paths.d.ts
1
2
  /**
2
3
  * Joins all given path segments together using the platform-specific separator as a delimiter.
3
4
  * The resulting path is normalized to remove any redundant or unnecessary segments.
@@ -5,5 +6,8 @@
5
6
  * @param segments - The path segments to join.
6
7
  * @returns The joined and normalized path string.
7
8
  */
8
- export declare function joinPaths(...segments: string[]): string;
9
- export declare const join: typeof joinPaths;
9
+ declare function joinPaths(...segments: string[]): string;
10
+ declare const join: typeof joinPaths;
11
+ //#endregion
12
+ export { joinPaths as n, join as t };
13
+ //# sourceMappingURL=join-paths-Bklwf_Bh.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths-Bklwf_Bh.d.mts","names":[],"sources":["../src/join-paths.ts"],"sourcesContent":[],"mappings":";;AAgFA;AAwBA;;;;;iBAxBgB,SAAA;cAwBH,aAAI"}
@@ -0,0 +1,13 @@
1
+ //#region src/join-paths.d.ts
2
+ /**
3
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
4
+ * The resulting path is normalized to remove any redundant or unnecessary segments.
5
+ *
6
+ * @param segments - The path segments to join.
7
+ * @returns The joined and normalized path string.
8
+ */
9
+ declare function joinPaths(...segments: string[]): string;
10
+ declare const join: typeof joinPaths;
11
+ //#endregion
12
+ export { joinPaths as n, join as t };
13
+ //# sourceMappingURL=join-paths-DBTcCEw0.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths-DBTcCEw0.d.cts","names":[],"sources":["../src/join-paths.ts"],"sourcesContent":[],"mappings":";;AAgFA;AAwBA;;;;;iBAxBgB,SAAA;cAwBH,aAAI"}
@@ -0,0 +1 @@
1
+ const e=require(`./regex-BEjSq2wo.cjs`),t=require(`./slash-DhzW1Om-.cjs`);function n(t=``){return t&&t.replace(/\\/g,`/`).replace(e.r,e=>e.toUpperCase())}function r(r){if(!r||r.length===0)return`.`;r=n(r);let i=r.match(e.c),a=t.r(r),s=r[r.length-1]===`/`;return r=o(r,!a),r.length===0?a?`/`:s?`./`:`.`:(s&&(r+=`/`),e.n.test(r)&&(r+=`/`),i?a?`//${r}`:`//./${r}`:a&&!t.r(r)?`/${r}`:r)}function i(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return r(t)}const a=i;function o(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}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
@@ -1,60 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.join = void 0;
7
- exports.joinPaths = joinPaths;
8
- var _isType = require("./is-type.cjs");
9
- var _regex = require("./regex.cjs");
10
- function m(n = "") {
11
- return n && n.replace(/\\/g, "/").replace(_regex.DRIVE_LETTER_START_REGEX, t => t.toUpperCase());
12
- }
13
- function R(n) {
14
- if (!n || n.length === 0) return ".";
15
- n = m(n);
16
- const t = n.match(_regex.UNC_REGEX),
17
- e = (0, _isType.isAbsolute)(n),
18
- l = n[n.length - 1] === "/";
19
- return n = a(n, !e), n.length === 0 ? e ? "/" : l ? "./" : "." : (l && (n += "/"), _regex.DRIVE_LETTER_REGEX.test(n) && (n += "/"), t ? e ? `//${n}` : `//./${n}` : e && !(0, _isType.isAbsolute)(n) ? `/${n}` : n);
20
- }
21
- function joinPaths(...n) {
22
- let t = "";
23
- for (const e of n) if (e) if (t.length > 0) {
24
- const l = t[t.length - 1] === "/",
25
- s = e[0] === "/";
26
- l && s ? t += e.slice(1) : t += l || s ? e : `/${e}`;
27
- } else t += e;
28
- return R(t);
29
- }
30
- const join = exports.join = joinPaths;
31
- function a(n, t) {
32
- let e = "",
33
- l = 0,
34
- s = -1,
35
- r = 0,
36
- o = null;
37
- for (let i = 0; i <= n.length; ++i) {
38
- if (i < n.length) o = n[i];else {
39
- if (o === "/") break;
40
- o = "/";
41
- }
42
- if (o === "/") {
43
- if (!(s === i - 1 || r === 1)) if (r === 2) {
44
- if (e.length < 2 || l !== 2 || e[e.length - 1] !== "." || e[e.length - 2] !== ".") {
45
- if (e.length > 2) {
46
- const f = e.lastIndexOf("/");
47
- f === -1 ? (e = "", l = 0) : (e = e.slice(0, f), l = e.length - 1 - e.lastIndexOf("/")), s = i, r = 0;
48
- continue;
49
- } else if (e.length > 0) {
50
- e = "", l = 0, s = i, r = 0;
51
- continue;
52
- }
53
- }
54
- t && (e += e.length > 0 ? "/.." : "..", l = 2);
55
- } else e.length > 0 ? e += `/${n.slice(s + 1, i)}` : e = n.slice(s + 1, i), l = i - s - 1;
56
- s = i, r = 0;
57
- } else o === "." && r !== -1 ? ++r : r = -1;
58
- }
59
- return e;
60
- }
1
+ const e=require(`./join-paths-hCBPtGlC.cjs`);exports.join=e.t,exports.joinPaths=e.n;
@@ -0,0 +1,2 @@
1
+ import { n as joinPaths, t as join } from "./join-paths-DBTcCEw0.cjs";
2
+ export { join, joinPaths };
@@ -0,0 +1,2 @@
1
+ import { n as joinPaths, t as join } from "./join-paths-Bklwf_Bh.mjs";
2
+ export { join, joinPaths };
@@ -1 +1 @@
1
- import{isAbsolute as g}from"./is-type";import{DRIVE_LETTER_REGEX as c,DRIVE_LETTER_START_REGEX as u,UNC_REGEX as E}from"./regex";function m(n=""){return n&&n.replace(/\\/g,"/").replace(u,t=>t.toUpperCase())}function R(n){if(!n||n.length===0)return".";n=m(n);const t=n.match(E),e=g(n),l=n[n.length-1]==="/";return n=a(n,!e),n.length===0?e?"/":l?"./":".":(l&&(n+="/"),c.test(n)&&(n+="/"),t?e?`//${n}`:`//./${n}`:e&&!g(n)?`/${n}`:n)}export function joinPaths(...n){let t="";for(const e of n)if(e)if(t.length>0){const l=t[t.length-1]==="/",s=e[0]==="/";l&&s?t+=e.slice(1):t+=l||s?e:`/${e}`}else t+=e;return R(t)}export const join=joinPaths;function a(n,t){let e="",l=0,s=-1,r=0,o=null;for(let i=0;i<=n.length;++i){if(i<n.length)o=n[i];else{if(o==="/")break;o="/"}if(o==="/"){if(!(s===i-1||r===1))if(r===2){if(e.length<2||l!==2||e[e.length-1]!=="."||e[e.length-2]!=="."){if(e.length>2){const f=e.lastIndexOf("/");f===-1?(e="",l=0):(e=e.slice(0,f),l=e.length-1-e.lastIndexOf("/")),s=i,r=0;continue}else if(e.length>0){e="",l=0,s=i,r=0;continue}}t&&(e+=e.length>0?"/..":"..",l=2)}else e.length>0?e+=`/${n.slice(s+1,i)}`:e=n.slice(s+1,i),l=i-s-1;s=i,r=0}else o==="."&&r!==-1?++r:r=-1}return e}
1
+ import{n as e,t}from"./join-paths-BLjJ0GmK.mjs";export{t as join,e as joinPaths};
package/dist/join.cjs CHANGED
@@ -1,16 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _joinPaths = require("./join-paths.cjs");
7
- Object.keys(_joinPaths).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _joinPaths[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _joinPaths[key];
14
- }
15
- });
16
- });
1
+ const e=require(`./join-paths-hCBPtGlC.cjs`);exports.join=e.t,exports.joinPaths=e.n;
@@ -0,0 +1,2 @@
1
+ import { n as joinPaths, t as join } from "./join-paths-DBTcCEw0.cjs";
2
+ export { join, joinPaths };
@@ -0,0 +1,2 @@
1
+ import { n as joinPaths, t as join } from "./join-paths-Bklwf_Bh.mjs";
2
+ export { join, joinPaths };
package/dist/join.mjs CHANGED
@@ -1 +1 @@
1
- export*from"./join-paths";
1
+ import{n as e,t}from"./join-paths-BLjJ0GmK.mjs";export{t as join,e as joinPaths};
@@ -1,16 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _correctPath = require("./correct-path.cjs");
7
- Object.keys(_correctPath).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _correctPath[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _correctPath[key];
14
- }
15
- });
16
- });
1
+ const e=require(`./correct-path-B0Y_kOkW.cjs`);exports.correctPath=e.t,exports.normalizeString=e.n,exports.normalizeWindowsPath=e.r,exports.stripStars=e.i,exports.toAbsolutePath=e.a,exports.toRelativePath=e.o,exports.withTrailingSlash=e.s;
@@ -0,0 +1,2 @@
1
+ import { a as toAbsolutePath, i as stripStars, n as normalizeString, o as toRelativePath, r as normalizeWindowsPath, s as withTrailingSlash, t as correctPath } from "./correct-path-CwHhpk6I.cjs";
2
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
@@ -0,0 +1,2 @@
1
+ import { a as toAbsolutePath, i as stripStars, n as normalizeString, o as toRelativePath, r as normalizeWindowsPath, s as withTrailingSlash, t as correctPath } from "./correct-path-LC5QqYV-.mjs";
2
+ export { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash };
@@ -1 +1 @@
1
- export*from"./correct-path";
1
+ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./correct-path-DmaZHNUF.mjs";export{o as correctPath,n as normalizeString,i as normalizeWindowsPath,t as stripStars,e as toAbsolutePath,r as toRelativePath,a as withTrailingSlash};
@@ -0,0 +1 @@
1
+ const e=/^[A-Z]:\//i,t=/^[A-Z]:$/i,n=/^[/\\]{2}/,r=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,i=/^\/([A-Z]:)?$/i,a=/\.[0-9a-z]+$/i,o=/^@\w+\/.*$/,s=/^(?:@[\w-]+\/)?[\w-]+$/;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
@@ -0,0 +1,12 @@
1
+ //#region src/regex.d.ts
2
+ declare const DRIVE_LETTER_START_REGEX: RegExp;
3
+ declare const DRIVE_LETTER_REGEX: RegExp;
4
+ declare const UNC_REGEX: RegExp;
5
+ declare const ABSOLUTE_PATH_REGEX: RegExp;
6
+ declare const ROOT_FOLDER_REGEX: RegExp;
7
+ declare const FILE_EXTENSION_REGEX: RegExp;
8
+ declare const PACKAGE_PATH_REGEX: RegExp;
9
+ declare const NPM_SCOPED_PACKAGE_REGEX: RegExp;
10
+ //#endregion
11
+ export { NPM_SCOPED_PACKAGE_REGEX as a, UNC_REGEX as c, FILE_EXTENSION_REGEX as i, DRIVE_LETTER_REGEX as n, PACKAGE_PATH_REGEX as o, DRIVE_LETTER_START_REGEX as r, ROOT_FOLDER_REGEX as s, ABSOLUTE_PATH_REGEX as t };
12
+ //# sourceMappingURL=regex-DHvK8l1E.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-DHvK8l1E.d.cts","names":[],"sources":["../src/regex.ts"],"sourcesContent":[],"mappings":";cAkBa,0BAAwB;AAAxB,cACA,kBADuC,EACrB,MADM;AACxB,cAEA,SAFgC,EAEvB,MAFS;AAElB,cAEA,mBAFuB,EAEJ,MAFI;AAEvB,cAGA,iBAHmB,EAGF,MAF2B;AAE5C,cAEA,oBAFiB,EAEG,MAFgB;AAEpC,cAEA,kBAFoB,EAEF,MAFoB;AAEtC,cACA,wBADiC,EACT,MADS"}
@@ -0,0 +1,12 @@
1
+ //#region src/regex.d.ts
2
+ declare const DRIVE_LETTER_START_REGEX: RegExp;
3
+ declare const DRIVE_LETTER_REGEX: RegExp;
4
+ declare const UNC_REGEX: RegExp;
5
+ declare const ABSOLUTE_PATH_REGEX: RegExp;
6
+ declare const ROOT_FOLDER_REGEX: RegExp;
7
+ declare const FILE_EXTENSION_REGEX: RegExp;
8
+ declare const PACKAGE_PATH_REGEX: RegExp;
9
+ declare const NPM_SCOPED_PACKAGE_REGEX: RegExp;
10
+ //#endregion
11
+ export { NPM_SCOPED_PACKAGE_REGEX as a, UNC_REGEX as c, FILE_EXTENSION_REGEX as i, DRIVE_LETTER_REGEX as n, PACKAGE_PATH_REGEX as o, DRIVE_LETTER_START_REGEX as r, ROOT_FOLDER_REGEX as s, ABSOLUTE_PATH_REGEX as t };
12
+ //# sourceMappingURL=regex-fq9t8ABF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-fq9t8ABF.d.mts","names":[],"sources":["../src/regex.ts"],"sourcesContent":[],"mappings":";cAkBa,0BAAwB;AAAxB,cACA,kBADuC,EACrB,MADM;AACxB,cAEA,SAFgC,EAEvB,MAFS;AAElB,cAEA,mBAFuB,EAEJ,MAFI;AAEvB,cAGA,iBAHmB,EAGF,MAF2B;AAE5C,cAEA,oBAFiB,EAEG,MAFgB;AAEpC,cAEA,kBAFoB,EAEF,MAFoB;AAEtC,cACA,wBADiC,EACT,MADS"}
@@ -0,0 +1,2 @@
1
+ const e=/^[A-Z]:\//i,t=/^[A-Z]:$/i,n=/^[/\\]{2}/,r=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,i=/^\/([A-Z]:)?$/i,a=/\.[0-9a-z]+$/i,o=/^@\w+\/.*$/,s=/^(?:@[\w-]+\/)?[\w-]+$/;export{s as a,n as c,a as i,t as n,o,e as r,i as s,r as t};
2
+ //# sourceMappingURL=regex-hMUNHeGK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-hMUNHeGK.mjs","names":[],"sources":["../src/regex.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\nexport const DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nexport const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\n\nexport const UNC_REGEX = /^[/\\\\]{2}/;\n\nexport const ABSOLUTE_PATH_REGEX =\n /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\n\nexport const ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\n\nexport const FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\n\nexport const PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nexport const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n"],"mappings":"AAkBA,MAAa,EAA2B,aAC3B,EAAqB,YAErB,EAAY,YAEZ,EACX,wDAEW,EAAoB,iBAEpB,EAAuB,gBAEvB,EAAqB,aACrB,EAA2B"}
package/dist/regex.cjs CHANGED
@@ -1,14 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UNC_REGEX = exports.ROOT_FOLDER_REGEX = exports.PACKAGE_PATH_REGEX = exports.NPM_SCOPED_PACKAGE_REGEX = exports.FILE_EXTENSION_REGEX = exports.DRIVE_LETTER_START_REGEX = exports.DRIVE_LETTER_REGEX = exports.ABSOLUTE_PATH_REGEX = void 0;
7
- const DRIVE_LETTER_START_REGEX = exports.DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i,
8
- DRIVE_LETTER_REGEX = exports.DRIVE_LETTER_REGEX = /^[A-Z]:$/i,
9
- UNC_REGEX = exports.UNC_REGEX = /^[/\\]{2}/,
10
- ABSOLUTE_PATH_REGEX = exports.ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,
11
- ROOT_FOLDER_REGEX = exports.ROOT_FOLDER_REGEX = /^\/([A-Z]:)?$/i,
12
- FILE_EXTENSION_REGEX = exports.FILE_EXTENSION_REGEX = /\.[0-9a-z]+$/i,
13
- PACKAGE_PATH_REGEX = exports.PACKAGE_PATH_REGEX = /^@\w+\/.*$/,
14
- NPM_SCOPED_PACKAGE_REGEX = exports.NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\w-]+\/)?[\w-]+$/;
1
+ const e=require(`./regex-BEjSq2wo.cjs`);exports.ABSOLUTE_PATH_REGEX=e.t,exports.DRIVE_LETTER_REGEX=e.n,exports.DRIVE_LETTER_START_REGEX=e.r,exports.FILE_EXTENSION_REGEX=e.i,exports.NPM_SCOPED_PACKAGE_REGEX=e.a,exports.PACKAGE_PATH_REGEX=e.o,exports.ROOT_FOLDER_REGEX=e.s,exports.UNC_REGEX=e.c;
@@ -0,0 +1,2 @@
1
+ import { a as NPM_SCOPED_PACKAGE_REGEX, c as UNC_REGEX, i as FILE_EXTENSION_REGEX, n as DRIVE_LETTER_REGEX, o as PACKAGE_PATH_REGEX, r as DRIVE_LETTER_START_REGEX, s as ROOT_FOLDER_REGEX, t as ABSOLUTE_PATH_REGEX } from "./regex-DHvK8l1E.cjs";
2
+ export { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX };
@@ -0,0 +1,2 @@
1
+ import { a as NPM_SCOPED_PACKAGE_REGEX, c as UNC_REGEX, i as FILE_EXTENSION_REGEX, n as DRIVE_LETTER_REGEX, o as PACKAGE_PATH_REGEX, r as DRIVE_LETTER_START_REGEX, s as ROOT_FOLDER_REGEX, t as ABSOLUTE_PATH_REGEX } from "./regex-fq9t8ABF.mjs";
2
+ export { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX };
package/dist/regex.mjs CHANGED
@@ -1 +1 @@
1
- export const DRIVE_LETTER_START_REGEX=/^[A-Z]:\//i,DRIVE_LETTER_REGEX=/^[A-Z]:$/i,UNC_REGEX=/^[/\\]{2}/,ABSOLUTE_PATH_REGEX=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i,ROOT_FOLDER_REGEX=/^\/([A-Z]:)?$/i,FILE_EXTENSION_REGEX=/\.[0-9a-z]+$/i,PACKAGE_PATH_REGEX=/^@\w+\/.*$/,NPM_SCOPED_PACKAGE_REGEX=/^(?:@[\w-]+\/)?[\w-]+$/;
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./regex-hMUNHeGK.mjs";export{s as ABSOLUTE_PATH_REGEX,r as DRIVE_LETTER_REGEX,a as DRIVE_LETTER_START_REGEX,n as FILE_EXTENSION_REGEX,e as NPM_SCOPED_PACKAGE_REGEX,i as PACKAGE_PATH_REGEX,o as ROOT_FOLDER_REGEX,t as UNC_REGEX};
@@ -1,3 +1,4 @@
1
+ //#region src/replace.d.ts
1
2
  /**
2
3
  * Replace the base path from the beginning of the given path.
3
4
  *
@@ -11,7 +12,7 @@
11
12
  * @param parentPath - The parent path to remove from the {@link childPath} parameter
12
13
  * @returns The {@link childPath} with the {@link parentPath} path removed
13
14
  */
14
- export declare function replacePath(childPath: string, parentPath?: string): string;
15
+ declare function replacePath(childPath: string, parentPath?: string): string;
15
16
  /**
16
17
  * Replace the extension of a given path with the provided value.
17
18
  *
@@ -27,4 +28,7 @@ export declare function replacePath(childPath: string, parentPath?: string): str
27
28
  * @param replacement - The value (or an empty string) to replace the current extension with
28
29
  * @returns The path with the replaced extension
29
30
  */
30
- export declare function replaceExtension(path: string, replacement?: string): string;
31
+ declare function replaceExtension(path: string, replacement?: string): string;
32
+ //#endregion
33
+ export { replacePath as n, replaceExtension as t };
34
+ //# sourceMappingURL=replace-0nP9MPWp.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-0nP9MPWp.d.cts","names":[],"sources":["../src/replace.ts"],"sourcesContent":[],"mappings":";;AAuCA;AAwBA;;;;;;;;;;;iBAxBgB,WAAA;;;;;;;;;;;;;;;;iBAwBA,gBAAA"}
@@ -0,0 +1 @@
1
+ const e=require(`./cwd-D66SsPHE.cjs`),t=require(`./slash-DhzW1Om-.cjs`),n=require(`./is-parent-path-ChIi6oAO.cjs`),r=require(`./file-path-fns-B9hKjfA-.cjs`);function i(r,i=e.t()){return n.t(r,i)?t.n(r).replace(t.n(i),``).replace(/^\//,``):r}function a(e,t=``){return e.replace(!t||t.includes(`.`)?r.a(e):r.s(e),t)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./cwd-DxrPG9WB.mjs";import{n as t}from"./slash-C7xRDucF.mjs";import{t as n}from"./is-parent-path-C0Azmjnd.mjs";import{a as r,s as i}from"./file-path-fns-MRI3PV8K.mjs";function a(r,i=e()){return n(r,i)?t(r).replace(t(i),``).replace(/^\//,``):r}function o(e,t=``){return e.replace(!t||t.includes(`.`)?r(e):i(e),t)}export{a as n,o as t};
2
+ //# sourceMappingURL=replace-C9dh7bEG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-C9dh7bEG.mjs","names":[],"sources":["../src/replace.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 { cwd } from \"./cwd\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"./file-path-fns\";\nimport { isParentPath } from \"./is-parent-path\";\nimport { slash } from \"./slash\";\n\n/**\n * Replace the base path from the beginning of the given path.\n *\n * @example\n * ```ts\n * replacePath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n * // returns \"src/index.ts\"\n * ```\n *\n * @param childPath - The child path to replace the {@link parentPath} substring from\n * @param parentPath - The parent path to remove from the {@link childPath} parameter\n * @returns The {@link childPath} with the {@link parentPath} path removed\n */\nexport function replacePath(\n childPath: string,\n parentPath: string = cwd()\n): string {\n return isParentPath(childPath, parentPath)\n ? slash(childPath).replace(slash(parentPath), \"\").replace(/^\\//, \"\")\n : childPath;\n}\n\n/**\n * Replace the extension of a given path with the provided value.\n *\n * @example\n * ```ts\n * replaceExtension(\"/home/user/project/src/index.ts\", \".js\");\n * // returns \"/home/user/project/src/index.js\"\n * replaceExtension(\"/home/user/project/src/index.ts\");\n * // returns \"/home/user/project/src/index\"\n * ```\n *\n * @param path - The path that will have its current extension replaced\n * @param replacement - The value (or an empty string) to replace the current extension with\n * @returns The path with the replaced extension\n */\nexport function replaceExtension(path: string, replacement = \"\"): string {\n return path.replace(\n !replacement || replacement.includes(\".\")\n ? findFileDotExtensionSafe(path)\n : findFileExtensionSafe(path),\n replacement\n );\n}\n"],"mappings":"0LAuCA,SAAgB,EACd,EACA,EAAqB,GAAK,CAClB,CACR,OAAO,EAAa,EAAW,EAAW,CACtC,EAAM,EAAU,CAAC,QAAQ,EAAM,EAAW,CAAE,GAAG,CAAC,QAAQ,MAAO,GAAG,CAClE,EAkBN,SAAgB,EAAiB,EAAc,EAAc,GAAY,CACvE,OAAO,EAAK,QACV,CAAC,GAAe,EAAY,SAAS,IAAI,CACrC,EAAyB,EAAK,CAC9B,EAAsB,EAAK,CAC/B,EACD"}
@@ -0,0 +1,34 @@
1
+ //#region src/replace.d.ts
2
+ /**
3
+ * Replace the base path from the beginning of the given path.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * replacePath("/home/user/project/src/index.ts", "/home/user/project");
8
+ * // returns "src/index.ts"
9
+ * ```
10
+ *
11
+ * @param childPath - The child path to replace the {@link parentPath} substring from
12
+ * @param parentPath - The parent path to remove from the {@link childPath} parameter
13
+ * @returns The {@link childPath} with the {@link parentPath} path removed
14
+ */
15
+ declare function replacePath(childPath: string, parentPath?: string): string;
16
+ /**
17
+ * Replace the extension of a given path with the provided value.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * replaceExtension("/home/user/project/src/index.ts", ".js");
22
+ * // returns "/home/user/project/src/index.js"
23
+ * replaceExtension("/home/user/project/src/index.ts");
24
+ * // returns "/home/user/project/src/index"
25
+ * ```
26
+ *
27
+ * @param path - The path that will have its current extension replaced
28
+ * @param replacement - The value (or an empty string) to replace the current extension with
29
+ * @returns The path with the replaced extension
30
+ */
31
+ declare function replaceExtension(path: string, replacement?: string): string;
32
+ //#endregion
33
+ export { replacePath as n, replaceExtension as t };
34
+ //# sourceMappingURL=replace-fEEM12P3.d.mts.map