@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-fEEM12P3.d.mts","names":[],"sources":["../src/replace.ts"],"sourcesContent":[],"mappings":";;AAuCA;AAwBA;;;;;;;;;;;iBAxBgB,WAAA;;;;;;;;;;;;;;;;iBAwBA,gBAAA"}
package/dist/replace.cjs CHANGED
@@ -1,17 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.replaceExtension = replaceExtension;
7
- exports.replacePath = replacePath;
8
- var _cwd = require("./cwd.cjs");
9
- var _filePathFns = require("./file-path-fns.cjs");
10
- var _isParentPath = require("./is-parent-path.cjs");
11
- var _slash = require("./slash.cjs");
12
- function replacePath(r, i = (0, _cwd.cwd)()) {
13
- return (0, _isParentPath.isParentPath)(r, i) ? (0, _slash.slash)(r).replace((0, _slash.slash)(i), "").replace(/^\//, "") : r;
14
- }
15
- function replaceExtension(r, i = "") {
16
- return r.replace(!i || i.includes(".") ? (0, _filePathFns.findFileDotExtensionSafe)(r) : (0, _filePathFns.findFileExtensionSafe)(r), i);
17
- }
1
+ const e=require(`./replace-C570sho0.cjs`);exports.replaceExtension=e.t,exports.replacePath=e.n;
@@ -0,0 +1,2 @@
1
+ import { n as replacePath, t as replaceExtension } from "./replace-0nP9MPWp.cjs";
2
+ export { replaceExtension, replacePath };
@@ -0,0 +1,2 @@
1
+ import { n as replacePath, t as replaceExtension } from "./replace-fEEM12P3.mjs";
2
+ export { replaceExtension, replacePath };
package/dist/replace.mjs CHANGED
@@ -1 +1 @@
1
- import{cwd as e}from"./cwd";import{findFileDotExtensionSafe as o,findFileExtensionSafe as t}from"./file-path-fns";import{isParentPath as s}from"./is-parent-path";import{slash as n}from"./slash";export function replacePath(r,i=e()){return s(r,i)?n(r).replace(n(i),"").replace(/^\//,""):r}export function replaceExtension(r,i=""){return r.replace(!i||i.includes(".")?o(r):t(r),i)}
1
+ import{n as e,t}from"./replace-C9dh7bEG.mjs";export{t as replaceExtension,e as replacePath};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./join-paths-BLjJ0GmK.mjs";const t=(t,n=1)=>{let r=t.replaceAll(/\/+$/g,``);for(let t=0;t<n;t++)r=e(r,`..`);return r};export{t};
2
+ //# sourceMappingURL=resolve-parent-path-5B4YvR_k.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-parent-path-5B4YvR_k.mjs","names":[],"sources":["../src/resolve-parent-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"./join-paths\";\n\n/**\n * Resolve the parent path of the provided path.\n *\n * @param path - The path to resolve.\n * @param count - The number of parent directories to traverse.\n * @returns The parent path of the provided path.\n */\nexport const resolveParentPath = (path: string, count: number = 1): string => {\n let parentPath = path.replaceAll(/\\/+$/g, \"\");\n for (let i = 0; i < count; i++) {\n parentPath = joinPaths(parentPath, \"..\");\n }\n return parentPath;\n};\n"],"mappings":"8CA2BA,MAAa,GAAqB,EAAc,EAAgB,IAAc,CAC5E,IAAI,EAAa,EAAK,WAAW,QAAS,GAAG,CAC7C,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,IACzB,EAAa,EAAU,EAAY,KAAK,CAE1C,OAAO"}
@@ -0,0 +1,12 @@
1
+ //#region src/resolve-parent-path.d.ts
2
+ /**
3
+ * Resolve the parent path of the provided path.
4
+ *
5
+ * @param path - The path to resolve.
6
+ * @param count - The number of parent directories to traverse.
7
+ * @returns The parent path of the provided path.
8
+ */
9
+ declare const resolveParentPath: (path: string, count?: number) => string;
10
+ //#endregion
11
+ export { resolveParentPath as t };
12
+ //# sourceMappingURL=resolve-parent-path-D5uwbjqj.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-parent-path-D5uwbjqj.d.mts","names":[],"sources":["../src/resolve-parent-path.ts"],"sourcesContent":[],"mappings":";;AA2BA;;;;;;cAAa"}
@@ -0,0 +1 @@
1
+ const e=require(`./join-paths-hCBPtGlC.cjs`),t=(t,n=1)=>{let r=t.replaceAll(/\/+$/g,``);for(let t=0;t<n;t++)r=e.n(r,`..`);return r};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -0,0 +1,12 @@
1
+ //#region src/resolve-parent-path.d.ts
2
+ /**
3
+ * Resolve the parent path of the provided path.
4
+ *
5
+ * @param path - The path to resolve.
6
+ * @param count - The number of parent directories to traverse.
7
+ * @returns The parent path of the provided path.
8
+ */
9
+ declare const resolveParentPath: (path: string, count?: number) => string;
10
+ //#endregion
11
+ export { resolveParentPath as t };
12
+ //# sourceMappingURL=resolve-parent-path-oZQZf2nw.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-parent-path-oZQZf2nw.d.cts","names":[],"sources":["../src/resolve-parent-path.ts"],"sourcesContent":[],"mappings":";;AA2BA;;;;;;cAAa"}
@@ -1,13 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.resolveParentPath = void 0;
7
- var _joinPaths = require("./join-paths.cjs");
8
- const resolveParentPath = (e, n = 1) => {
9
- let r = e.replaceAll(/\/+$/g, "");
10
- for (let t = 0; t < n; t++) r = (0, _joinPaths.joinPaths)(r, "..");
11
- return r;
12
- };
13
- exports.resolveParentPath = resolveParentPath;
1
+ const e=require(`./resolve-parent-path-DIrSH2oN.cjs`);exports.resolveParentPath=e.t;
@@ -0,0 +1,2 @@
1
+ import { t as resolveParentPath } from "./resolve-parent-path-oZQZf2nw.cjs";
2
+ export { resolveParentPath };
@@ -0,0 +1,2 @@
1
+ import { t as resolveParentPath } from "./resolve-parent-path-D5uwbjqj.mjs";
2
+ export { resolveParentPath };
@@ -1 +1 @@
1
- import{joinPaths as o}from"./join-paths";export const resolveParentPath=(e,n=1)=>{let r=e.replaceAll(/\/+$/g,"");for(let t=0;t<n;t++)r=o(r,"..");return r};
1
+ import{t as e}from"./resolve-parent-path-5B4YvR_k.mjs";export{e as resolveParentPath};
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./regex-hMUNHeGK.mjs";function n(e){return t.test(c(e))}function r(e){return n(e)}function i(e){return!n(e)}function a(e){return i(e)}function o(t){return e.test(c(t))}function s(e){return o(e)}function c(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function l(e){let t=c(e);return n(t)?t.replace(/\/+$/g,``):t.replace(/^\.\//g,``).replace(/\/+$/g,``)}export{s as a,i as c,n as i,c as n,o,r,a as s,l as t};
2
+ //# sourceMappingURL=slash-C7xRDucF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-C7xRDucF.mjs","names":[],"sources":["../src/is-type.ts","../src/slash.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 { ABSOLUTE_PATH_REGEX, NPM_SCOPED_PACKAGE_REGEX } from \"./regex\";\nimport { slash } from \"./slash\";\n\n/**\n * Check if the path is an absolute path.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is an absolute path\n */\nexport function isAbsolutePath(path: string): boolean {\n return ABSOLUTE_PATH_REGEX.test(slash(path));\n}\n\n/**\n * Check if the path is an absolute path.\n *\n * @remarks\n * This is an alias for {@link isAbsolutePath}.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is an absolute path\n */\nexport function isAbsolute(path: string): boolean {\n return isAbsolutePath(path);\n}\n\n/**\n * Check if the path is a relative path.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a relative path\n */\nexport function isRelativePath(path: string): boolean {\n return !isAbsolutePath(path);\n}\n\n/**\n * Check if the path is a relative path.\n *\n * @remarks\n * This is an alias for {@link isRelativePath}.\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a relative path\n */\nexport function isRelative(path: string): boolean {\n return isRelativePath(path);\n}\n\n/**\n * Check if the path is a npm package path.\n *\n * @remarks\n * 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}.\n *\n * @example\n * ```ts\n * isNpmScopedPackage(\"@stryke/path\"); // returns true\n * isNpmScopedPackage(\"lodash\"); // returns false\n * isNpmNamespacePackage(\"./src/index.ts\"); // returns false\n * ```\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a npm package path\n */\nexport function isNpmScopedPackagePath(path: string): boolean {\n return NPM_SCOPED_PACKAGE_REGEX.test(slash(path));\n}\n\n/**\n * Check if the path is a npm package path.\n *\n * @remarks\n * 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}.\n *\n * @example\n * ```ts\n * isNpmScopedPackagePath(\"@stryke/path\"); // returns true\n * isNpmScopedPackagePath(\"lodash\"); // returns false\n * isNpmScopedPackagePath(\"./src/index.ts\"); // returns false\n * ```\n *\n * @param path - The path to check\n * @returns An indicator specifying if the path is a npm package path\n */\nexport function isNpmScopedPackage(path: string): boolean {\n return isNpmScopedPackagePath(path);\n}\n","/* -------------------------------------------------------------------\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 { isAbsolutePath } from \"./is-type\";\n\n/**\n * Replace backslash to slash\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function slash(path: string) {\n if (path.startsWith(\"\\\\\\\\?\\\\\")) {\n return path;\n }\n\n return path.replace(/\\\\/g, \"/\");\n}\n\n/**\n * Replace backslash to slash and remove unneeded leading and trailing slashes\n *\n * @param path - The string to replace\n * @returns The string with replaced backslashes\n */\nexport function formatSlash(path: string) {\n const formatted = slash(path);\n\n return isAbsolutePath(formatted)\n ? formatted.replace(/\\/+$/g, \"\")\n : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n"],"mappings":"2CA2BA,SAAgB,EAAe,EAAuB,CACpD,OAAO,EAAoB,KAAK,EAAM,EAAK,CAAC,CAY9C,SAAgB,EAAW,EAAuB,CAChD,OAAO,EAAe,EAAK,CAS7B,SAAgB,EAAe,EAAuB,CACpD,MAAO,CAAC,EAAe,EAAK,CAY9B,SAAgB,EAAW,EAAuB,CAChD,OAAO,EAAe,EAAK,CAmB7B,SAAgB,EAAuB,EAAuB,CAC5D,OAAO,EAAyB,KAAK,EAAM,EAAK,CAAC,CAmBnD,SAAgB,EAAmB,EAAuB,CACxD,OAAO,EAAuB,EAAK,CC9ErC,SAAgB,EAAM,EAAc,CAKlC,OAJI,EAAK,WAAW,UAAU,CACrB,EAGF,EAAK,QAAQ,MAAO,IAAI,CASjC,SAAgB,EAAY,EAAc,CACxC,IAAM,EAAY,EAAM,EAAK,CAE7B,OAAO,EAAe,EAAU,CAC5B,EAAU,QAAQ,QAAS,GAAG,CAC9B,EAAU,QAAQ,SAAU,GAAG,CAAC,QAAQ,QAAS,GAAG"}
@@ -1,14 +1,18 @@
1
+ //#region src/slash.d.ts
1
2
  /**
2
3
  * Replace backslash to slash
3
4
  *
4
5
  * @param path - The string to replace
5
6
  * @returns The string with replaced backslashes
6
7
  */
7
- export declare function slash(path: string): string;
8
+ declare function slash(path: string): string;
8
9
  /**
9
10
  * Replace backslash to slash and remove unneeded leading and trailing slashes
10
11
  *
11
12
  * @param path - The string to replace
12
13
  * @returns The string with replaced backslashes
13
14
  */
14
- export declare function formatSlash(path: string): string;
15
+ declare function formatSlash(path: string): string;
16
+ //#endregion
17
+ export { slash as n, formatSlash as t };
18
+ //# sourceMappingURL=slash-CuA7ERRf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-CuA7ERRf.d.mts","names":[],"sources":["../src/slash.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAcA;;;;iBAdgB,KAAA;;;;;;;iBAcA,WAAA"}
@@ -0,0 +1,18 @@
1
+ //#region src/slash.d.ts
2
+ /**
3
+ * Replace backslash to slash
4
+ *
5
+ * @param path - The string to replace
6
+ * @returns The string with replaced backslashes
7
+ */
8
+ declare function slash(path: string): string;
9
+ /**
10
+ * Replace backslash to slash and remove unneeded leading and trailing slashes
11
+ *
12
+ * @param path - The string to replace
13
+ * @returns The string with replaced backslashes
14
+ */
15
+ declare function formatSlash(path: string): string;
16
+ //#endregion
17
+ export { slash as n, formatSlash as t };
18
+ //# sourceMappingURL=slash-DPd6cWOz.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-DPd6cWOz.d.cts","names":[],"sources":["../src/slash.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAcA;;;;iBAdgB,KAAA;;;;;;;iBAcA,WAAA"}
@@ -0,0 +1 @@
1
+ const e=require(`./regex-BEjSq2wo.cjs`);function t(t){return e.t.test(s(t))}function n(e){return t(e)}function r(e){return!t(e)}function i(e){return r(e)}function a(t){return e.a.test(s(t))}function o(e){return a(e)}function s(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}function c(e){let n=s(e);return t(n)?n.replace(/\/+$/g,``):n.replace(/^\.\//g,``).replace(/\/+$/g,``)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
package/dist/slash.cjs CHANGED
@@ -1,15 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatSlash = formatSlash;
7
- exports.slash = slash;
8
- var _isType = require("./is-type.cjs");
9
- function slash(r) {
10
- return r.startsWith("\\\\?\\") ? r : r.replace(/\\/g, "/");
11
- }
12
- function formatSlash(r) {
13
- const t = slash(r);
14
- return (0, _isType.isAbsolutePath)(t) ? t.replace(/\/+$/g, "") : t.replace(/^\.\//g, "").replace(/\/+$/g, "");
15
- }
1
+ const e=require(`./slash-DhzW1Om-.cjs`);exports.formatSlash=e.t,exports.slash=e.n;
@@ -0,0 +1,2 @@
1
+ import { n as slash, t as formatSlash } from "./slash-DPd6cWOz.cjs";
2
+ export { formatSlash, slash };
@@ -0,0 +1,2 @@
1
+ import { n as slash, t as formatSlash } from "./slash-CuA7ERRf.mjs";
2
+ export { formatSlash, slash };
package/dist/slash.mjs CHANGED
@@ -1 +1 @@
1
- import{isAbsolutePath as e}from"./is-type";export function slash(r){return r.startsWith("\\\\?\\")?r:r.replace(/\\/g,"/")}export function formatSlash(r){const t=slash(r);return e(t)?t.replace(/\/+$/g,""):t.replace(/^\.\//g,"").replace(/\/+$/g,"")}
1
+ import{n as e,t}from"./slash-C7xRDucF.mjs";export{t as formatSlash,e as slash};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/path",
3
- "version": "0.21.6",
3
+ "version": "0.22.7",
4
4
  "type": "module",
5
5
  "description": "A package containing various utilities that expand the functionality of NodeJs's built-in `path` module",
6
6
  "repository": {
@@ -9,276 +9,73 @@
9
9
  "directory": "packages/path"
10
10
  },
11
11
  "private": false,
12
- "devDependencies": {
13
- "@storm-software/testing-tools": "^1.119.50",
14
- "@stryke/convert": "^0.6.12",
15
- "@stryke/type-checks": "^0.4.3",
16
- "@stryke/types": "^0.10.12"
17
- },
18
- "publishConfig": { "access": "public" },
19
- "dependencies": {},
20
- "sideEffects": false,
21
- "files": ["dist/**/*"],
22
- "homepage": "https://stormsoftware.com",
23
- "bugs": {
24
- "url": "https://stormsoftware.com/support",
25
- "email": "support@stormsoftware.com"
26
- },
27
- "license": "Apache-2.0",
28
- "keywords": [
29
- "stryke",
30
- "typescript",
31
- "utilities",
32
- "storm-software",
33
- "storm",
34
- "storm-ops",
35
- "cyclone-ui",
36
- "sullivanpj",
37
- "monorepo"
38
- ],
39
- "funding": {
40
- "type": "github",
41
- "url": "https://github.com/sponsors/storm-software"
42
- },
43
- "author": {
44
- "name": "Storm Software",
45
- "email": "contact@stormsoftware.com",
46
- "url": "https://stormsoftware.com"
47
- },
48
- "maintainers": [
49
- {
50
- "name": "Storm Software",
51
- "email": "contact@stormsoftware.com",
52
- "url": "https://stormsoftware.com"
53
- }
54
- ],
55
- "contributors": [
56
- {
57
- "name": "Storm Software",
58
- "email": "contact@stormsoftware.com",
59
- "url": "https://stormsoftware.com"
60
- }
61
- ],
12
+ "main": "./dist/index.cjs",
13
+ "module": "./dist/index.mjs",
62
14
  "exports": {
63
- "./slash": {
64
- "import": { "types": "./dist/slash.d.ts", "default": "./dist/slash.mjs" },
65
- "require": {
66
- "types": "./dist/slash.d.ts",
67
- "default": "./dist/slash.cjs"
68
- },
69
- "default": { "types": "./dist/slash.d.ts", "default": "./dist/slash.mjs" }
70
- },
71
- "./resolve-parent-path": {
72
- "import": {
73
- "types": "./dist/resolve-parent-path.d.ts",
74
- "default": "./dist/resolve-parent-path.mjs"
75
- },
76
- "require": {
77
- "types": "./dist/resolve-parent-path.d.ts",
78
- "default": "./dist/resolve-parent-path.cjs"
79
- },
80
- "default": {
81
- "types": "./dist/resolve-parent-path.d.ts",
82
- "default": "./dist/resolve-parent-path.mjs"
83
- }
84
- },
85
- "./replace": {
86
- "import": {
87
- "types": "./dist/replace.d.ts",
88
- "default": "./dist/replace.mjs"
89
- },
90
- "require": {
91
- "types": "./dist/replace.d.ts",
92
- "default": "./dist/replace.cjs"
93
- },
94
- "default": {
95
- "types": "./dist/replace.d.ts",
96
- "default": "./dist/replace.mjs"
97
- }
98
- },
99
- "./regex": {
100
- "import": { "types": "./dist/regex.d.ts", "default": "./dist/regex.mjs" },
101
- "require": {
102
- "types": "./dist/regex.d.ts",
103
- "default": "./dist/regex.cjs"
104
- },
105
- "default": { "types": "./dist/regex.d.ts", "default": "./dist/regex.mjs" }
106
- },
107
- "./normalize": {
108
- "import": {
109
- "types": "./dist/normalize.d.ts",
110
- "default": "./dist/normalize.mjs"
111
- },
112
- "require": {
113
- "types": "./dist/normalize.d.ts",
114
- "default": "./dist/normalize.cjs"
115
- },
116
- "default": {
117
- "types": "./dist/normalize.d.ts",
118
- "default": "./dist/normalize.mjs"
119
- }
15
+ ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
16
+ "./append": {
17
+ "require": "./dist/append.cjs",
18
+ "import": "./dist/append.mjs"
120
19
  },
121
- "./join": {
122
- "import": { "types": "./dist/join.d.ts", "default": "./dist/join.mjs" },
123
- "require": { "types": "./dist/join.d.ts", "default": "./dist/join.cjs" },
124
- "default": { "types": "./dist/join.d.ts", "default": "./dist/join.mjs" }
20
+ "./asset-extensions": {
21
+ "require": "./dist/asset-extensions.cjs",
22
+ "import": "./dist/asset-extensions.mjs"
125
23
  },
126
- "./join-paths": {
127
- "import": {
128
- "types": "./dist/join-paths.d.ts",
129
- "default": "./dist/join-paths.mjs"
130
- },
131
- "require": {
132
- "types": "./dist/join-paths.d.ts",
133
- "default": "./dist/join-paths.cjs"
134
- },
135
- "default": {
136
- "types": "./dist/join-paths.d.ts",
137
- "default": "./dist/join-paths.mjs"
138
- }
24
+ "./correct-path": {
25
+ "require": "./dist/correct-path.cjs",
26
+ "import": "./dist/correct-path.mjs"
139
27
  },
140
- "./is-type": {
141
- "import": {
142
- "types": "./dist/is-type.d.ts",
143
- "default": "./dist/is-type.mjs"
144
- },
145
- "require": {
146
- "types": "./dist/is-type.d.ts",
147
- "default": "./dist/is-type.cjs"
148
- },
149
- "default": {
150
- "types": "./dist/is-type.d.ts",
151
- "default": "./dist/is-type.mjs"
152
- }
28
+ "./cwd": { "require": "./dist/cwd.cjs", "import": "./dist/cwd.mjs" },
29
+ "./delimiter": {
30
+ "require": "./dist/delimiter.cjs",
31
+ "import": "./dist/delimiter.mjs"
153
32
  },
154
- "./is-root-dir": {
155
- "import": {
156
- "types": "./dist/is-root-dir.d.ts",
157
- "default": "./dist/is-root-dir.mjs"
158
- },
159
- "require": {
160
- "types": "./dist/is-root-dir.d.ts",
161
- "default": "./dist/is-root-dir.cjs"
162
- },
163
- "default": {
164
- "types": "./dist/is-root-dir.d.ts",
165
- "default": "./dist/is-root-dir.mjs"
166
- }
33
+ "./file-path-fns": {
34
+ "require": "./dist/file-path-fns.cjs",
35
+ "import": "./dist/file-path-fns.mjs"
167
36
  },
37
+ "./find": { "require": "./dist/find.cjs", "import": "./dist/find.mjs" },
168
38
  "./is-parent-path": {
169
- "import": {
170
- "types": "./dist/is-parent-path.d.ts",
171
- "default": "./dist/is-parent-path.mjs"
172
- },
173
- "require": {
174
- "types": "./dist/is-parent-path.d.ts",
175
- "default": "./dist/is-parent-path.cjs"
176
- },
177
- "default": {
178
- "types": "./dist/is-parent-path.d.ts",
179
- "default": "./dist/is-parent-path.mjs"
180
- }
181
- },
182
- "./index": {
183
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
184
- "require": {
185
- "types": "./dist/index.d.ts",
186
- "default": "./dist/index.cjs"
187
- },
188
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
189
- },
190
- "./find": {
191
- "import": { "types": "./dist/find.d.ts", "default": "./dist/find.mjs" },
192
- "require": { "types": "./dist/find.d.ts", "default": "./dist/find.cjs" },
193
- "default": { "types": "./dist/find.d.ts", "default": "./dist/find.mjs" }
194
- },
195
- "./file-path-fns": {
196
- "import": {
197
- "types": "./dist/file-path-fns.d.ts",
198
- "default": "./dist/file-path-fns.mjs"
199
- },
200
- "require": {
201
- "types": "./dist/file-path-fns.d.ts",
202
- "default": "./dist/file-path-fns.cjs"
203
- },
204
- "default": {
205
- "types": "./dist/file-path-fns.d.ts",
206
- "default": "./dist/file-path-fns.mjs"
207
- }
39
+ "require": "./dist/is-parent-path.cjs",
40
+ "import": "./dist/is-parent-path.mjs"
208
41
  },
209
- "./delimiter": {
210
- "import": {
211
- "types": "./dist/delimiter.d.ts",
212
- "default": "./dist/delimiter.mjs"
213
- },
214
- "require": {
215
- "types": "./dist/delimiter.d.ts",
216
- "default": "./dist/delimiter.cjs"
217
- },
218
- "default": {
219
- "types": "./dist/delimiter.d.ts",
220
- "default": "./dist/delimiter.mjs"
221
- }
42
+ "./is-root-dir": {
43
+ "require": "./dist/is-root-dir.cjs",
44
+ "import": "./dist/is-root-dir.mjs"
222
45
  },
223
- "./cwd": {
224
- "import": { "types": "./dist/cwd.d.ts", "default": "./dist/cwd.mjs" },
225
- "require": { "types": "./dist/cwd.d.ts", "default": "./dist/cwd.cjs" },
226
- "default": { "types": "./dist/cwd.d.ts", "default": "./dist/cwd.mjs" }
46
+ "./is-type": {
47
+ "require": "./dist/is-type.cjs",
48
+ "import": "./dist/is-type.mjs"
227
49
  },
228
- "./correct-path": {
229
- "import": {
230
- "types": "./dist/correct-path.d.ts",
231
- "default": "./dist/correct-path.mjs"
232
- },
233
- "require": {
234
- "types": "./dist/correct-path.d.ts",
235
- "default": "./dist/correct-path.cjs"
236
- },
237
- "default": {
238
- "types": "./dist/correct-path.d.ts",
239
- "default": "./dist/correct-path.mjs"
240
- }
50
+ "./join": { "require": "./dist/join.cjs", "import": "./dist/join.mjs" },
51
+ "./join-paths": {
52
+ "require": "./dist/join-paths.cjs",
53
+ "import": "./dist/join-paths.mjs"
241
54
  },
242
- "./asset-extensions": {
243
- "import": {
244
- "types": "./dist/asset-extensions.d.ts",
245
- "default": "./dist/asset-extensions.mjs"
246
- },
247
- "require": {
248
- "types": "./dist/asset-extensions.d.ts",
249
- "default": "./dist/asset-extensions.cjs"
250
- },
251
- "default": {
252
- "types": "./dist/asset-extensions.d.ts",
253
- "default": "./dist/asset-extensions.mjs"
254
- }
55
+ "./normalize": {
56
+ "require": "./dist/normalize.cjs",
57
+ "import": "./dist/normalize.mjs"
255
58
  },
256
- "./append": {
257
- "import": {
258
- "types": "./dist/append.d.ts",
259
- "default": "./dist/append.mjs"
260
- },
261
- "require": {
262
- "types": "./dist/append.d.ts",
263
- "default": "./dist/append.cjs"
264
- },
265
- "default": {
266
- "types": "./dist/append.d.ts",
267
- "default": "./dist/append.mjs"
268
- }
59
+ "./regex": { "require": "./dist/regex.cjs", "import": "./dist/regex.mjs" },
60
+ "./replace": {
61
+ "require": "./dist/replace.cjs",
62
+ "import": "./dist/replace.mjs"
269
63
  },
270
- ".": {
271
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
272
- "require": {
273
- "types": "./dist/index.d.ts",
274
- "default": "./dist/index.cjs"
275
- },
276
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
64
+ "./resolve-parent-path": {
65
+ "require": "./dist/resolve-parent-path.cjs",
66
+ "import": "./dist/resolve-parent-path.mjs"
277
67
  },
278
- "./package.json": "./package.json"
68
+ "./slash": { "require": "./dist/slash.cjs", "import": "./dist/slash.mjs" },
69
+ "./*": "./*"
279
70
  },
280
- "main": "./dist/index.cjs",
281
- "module": "./dist/index.mjs",
282
- "types": "./dist/index.d.ts",
283
- "gitHead": "dc6b0d55613d96152664c76d6f2f6ab6fb9736b1"
71
+ "types": "./dist/index.d.cts",
72
+ "devDependencies": {
73
+ "@storm-software/testing-tools": "^1.119.59",
74
+ "@stryke/convert": "^0.6.20",
75
+ "@stryke/type-checks": "^0.5.5",
76
+ "@stryke/types": "^0.10.19",
77
+ "tsdown": "^0.17.1"
78
+ },
79
+ "publishConfig": { "access": "public" },
80
+ "gitHead": "5c645896466d1f6a26fb9cf9748ba226dd4d1f07"
284
81
  }
@@ -1,18 +0,0 @@
1
- /**
2
- * The platform-specific file delimiter.
3
- *
4
- * Equals to `";"` in windows and `":"` in all other platforms.
5
- */
6
- export declare const delimiter: ";" | ":";
7
- export declare const posix: {
8
- posix: any;
9
- win32: any;
10
- } & {
11
- delimiter: ";" | ":";
12
- };
13
- export declare const win32: {
14
- posix: any;
15
- win32: any;
16
- } & {
17
- delimiter: ";" | ":";
18
- };
package/dist/find.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./file-path-fns";
package/dist/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * The path library used by Storm Software for building NodeJS applications.
3
- *
4
- * @remarks
5
- * A package containing various utilities that expand the functionality of NodeJs's `path` module
6
- *
7
- * @packageDocumentation
8
- */
9
- export * from "./append";
10
- export * from "./asset-extensions";
11
- export * from "./correct-path";
12
- export * from "./cwd";
13
- export * from "./delimiter";
14
- export * from "./file-path-fns";
15
- export * from "./is-parent-path";
16
- export * from "./is-root-dir";
17
- export * from "./join-paths";
18
- export * from "./regex";
19
- export * from "./replace";
20
- export * from "./resolve-parent-path";
21
- export * from "./slash";
package/dist/join.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./join-paths";
@@ -1 +0,0 @@
1
- export * from "./correct-path";
package/dist/regex.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export declare const DRIVE_LETTER_START_REGEX: RegExp;
2
- export declare const DRIVE_LETTER_REGEX: RegExp;
3
- export declare const UNC_REGEX: RegExp;
4
- export declare const ABSOLUTE_PATH_REGEX: RegExp;
5
- export declare const ROOT_FOLDER_REGEX: RegExp;
6
- export declare const FILE_EXTENSION_REGEX: RegExp;
7
- export declare const PACKAGE_PATH_REGEX: RegExp;
8
- export declare const NPM_SCOPED_PACKAGE_REGEX: RegExp;
@@ -1,8 +0,0 @@
1
- /**
2
- * Resolve the parent path of the provided path.
3
- *
4
- * @param path - The path to resolve.
5
- * @param count - The number of parent directories to traverse.
6
- * @returns The parent path of the provided path.
7
- */
8
- export declare const resolveParentPath: (path: string, count?: number) => string;