@stryke/string-format 0.14.8 → 0.16.0

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 (45) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/index.cjs +4 -0
  3. package/dist/index.d.cts +4 -2
  4. package/dist/index.d.mts +4 -2
  5. package/dist/index.mjs +3 -1
  6. package/dist/list.cjs +25 -0
  7. package/dist/list.d.cts +17 -0
  8. package/dist/list.d.cts.map +1 -0
  9. package/dist/list.d.mts +17 -0
  10. package/dist/list.d.mts.map +1 -0
  11. package/dist/list.mjs +25 -0
  12. package/dist/list.mjs.map +1 -0
  13. package/dist/path/src/correct-path.cjs +120 -0
  14. package/dist/path/src/correct-path.mjs +120 -0
  15. package/dist/path/src/correct-path.mjs.map +1 -0
  16. package/dist/path/src/cwd.cjs +17 -0
  17. package/dist/path/src/cwd.mjs +17 -0
  18. package/dist/path/src/cwd.mjs.map +1 -0
  19. package/dist/path/src/is-type.cjs +29 -0
  20. package/dist/path/src/is-type.mjs +29 -0
  21. package/dist/path/src/is-type.mjs.map +1 -0
  22. package/dist/path/src/join-paths.cjs +122 -0
  23. package/dist/path/src/join-paths.mjs +123 -0
  24. package/dist/path/src/join-paths.mjs.map +1 -0
  25. package/dist/path/src/regex.cjs +12 -0
  26. package/dist/path/src/regex.mjs +9 -0
  27. package/dist/path/src/regex.mjs.map +1 -0
  28. package/dist/path/src/slash.cjs +15 -0
  29. package/dist/path/src/slash.mjs +15 -0
  30. package/dist/path/src/slash.mjs.map +1 -0
  31. package/dist/pretty-path.cjs +17 -0
  32. package/dist/pretty-path.d.cts +27 -0
  33. package/dist/pretty-path.d.cts.map +1 -0
  34. package/dist/pretty-path.d.mts +27 -0
  35. package/dist/pretty-path.d.mts.map +1 -0
  36. package/dist/pretty-path.mjs +18 -0
  37. package/dist/pretty-path.mjs.map +1 -0
  38. package/dist/title-case.cjs +2 -1
  39. package/dist/title-case.d.cts +13 -3
  40. package/dist/title-case.d.cts.map +1 -1
  41. package/dist/title-case.d.mts +13 -3
  42. package/dist/title-case.d.mts.map +1 -1
  43. package/dist/title-case.mjs +2 -1
  44. package/dist/title-case.mjs.map +1 -1
  45. package/package.json +8 -2
@@ -0,0 +1,122 @@
1
+ const require_regex = require('./regex.cjs');
2
+ const require_is_type = require('./is-type.cjs');
3
+ const require_slash = require('./slash.cjs');
4
+
5
+ //#region ../path/src/join-paths.ts
6
+ function normalizeWindowsPath(input = "") {
7
+ if (!input) return input;
8
+ return input.replace(/\\/g, "/").replace(require_regex.DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
9
+ }
10
+ function correctPaths(path) {
11
+ if (!path || path.length === 0) return ".";
12
+ path = normalizeWindowsPath(path);
13
+ const isUNCPath = path.match(require_regex.UNC_REGEX);
14
+ const isPathAbsolute = require_is_type.isAbsolute(path);
15
+ const trailingSeparator = path[path.length - 1] === "/";
16
+ path = normalizeString(path, !isPathAbsolute);
17
+ if (path.length === 0) {
18
+ if (isPathAbsolute) return "/";
19
+ return trailingSeparator ? "./" : ".";
20
+ }
21
+ if (trailingSeparator) path += "/";
22
+ if (require_regex.DRIVE_LETTER_REGEX.test(path)) path += "/";
23
+ if (isUNCPath) {
24
+ if (!isPathAbsolute) return `//./${path}`;
25
+ return `//${path}`;
26
+ }
27
+ return isPathAbsolute && !require_is_type.isAbsolute(path) ? `/${path}` : path;
28
+ }
29
+ /**
30
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
31
+ *
32
+ * @remarks
33
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { joinPaths } from 'stryke/path';
38
+ *
39
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
40
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
41
+ *
42
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
43
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
44
+ *
45
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
46
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
47
+ *
48
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
49
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
50
+ * ```
51
+ *
52
+ * @param segments - The path segments to join.
53
+ * @returns The joined and normalized path string.
54
+ */
55
+ function joinPaths(...segments) {
56
+ let result = "";
57
+ for (const segment of segments) if (segment && require_slash.slash(segment).replaceAll(/\//g, "") !== ".") {
58
+ if (result) if (require_slash.slash(segment).replaceAll(/\//g, "") === "..") result = require_slash.slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
59
+ else result = `${require_slash.slash(result).replace(/\/+$/, "")}/${require_slash.slash(segment).replace(/^\/+/, "")}`;
60
+ else if (require_slash.slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
61
+ }
62
+ return correctPaths(result);
63
+ }
64
+ /**
65
+ * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
66
+ *
67
+ * @param path - The path to normalize.
68
+ * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
69
+ * @returns the normalized path string.
70
+ */
71
+ function normalizeString(path, allowAboveRoot) {
72
+ let res = "";
73
+ let lastSegmentLength = 0;
74
+ let lastSlash = -1;
75
+ let dots = 0;
76
+ let char = null;
77
+ for (let index = 0; index <= path.length; ++index) {
78
+ if (index < path.length) char = path[index];
79
+ else if (char === "/") break;
80
+ else char = "/";
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
83
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
84
+ if (res.length > 2) {
85
+ const lastSlashIndex = res.lastIndexOf("/");
86
+ if (lastSlashIndex === -1) {
87
+ res = "";
88
+ lastSegmentLength = 0;
89
+ } else {
90
+ res = res.slice(0, lastSlashIndex);
91
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
92
+ }
93
+ lastSlash = index;
94
+ dots = 0;
95
+ continue;
96
+ } else if (res.length > 0) {
97
+ res = "";
98
+ lastSegmentLength = 0;
99
+ lastSlash = index;
100
+ dots = 0;
101
+ continue;
102
+ }
103
+ }
104
+ if (allowAboveRoot) {
105
+ res += res.length > 0 ? "/.." : "..";
106
+ lastSegmentLength = 2;
107
+ }
108
+ } else {
109
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
110
+ else res = path.slice(lastSlash + 1, index);
111
+ lastSegmentLength = index - lastSlash - 1;
112
+ }
113
+ lastSlash = index;
114
+ dots = 0;
115
+ } else if (char === "." && dots !== -1) ++dots;
116
+ else dots = -1;
117
+ }
118
+ return res;
119
+ }
120
+
121
+ //#endregion
122
+ exports.joinPaths = joinPaths;
@@ -0,0 +1,123 @@
1
+ import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from "./regex.mjs";
2
+ import { isAbsolute } from "./is-type.mjs";
3
+ import { slash } from "./slash.mjs";
4
+
5
+ //#region ../path/src/join-paths.ts
6
+ function normalizeWindowsPath(input = "") {
7
+ if (!input) return input;
8
+ return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
9
+ }
10
+ function correctPaths(path) {
11
+ if (!path || path.length === 0) return ".";
12
+ path = normalizeWindowsPath(path);
13
+ const isUNCPath = path.match(UNC_REGEX);
14
+ const isPathAbsolute = isAbsolute(path);
15
+ const trailingSeparator = path[path.length - 1] === "/";
16
+ path = normalizeString(path, !isPathAbsolute);
17
+ if (path.length === 0) {
18
+ if (isPathAbsolute) return "/";
19
+ return trailingSeparator ? "./" : ".";
20
+ }
21
+ if (trailingSeparator) path += "/";
22
+ if (DRIVE_LETTER_REGEX.test(path)) path += "/";
23
+ if (isUNCPath) {
24
+ if (!isPathAbsolute) return `//./${path}`;
25
+ return `//${path}`;
26
+ }
27
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
28
+ }
29
+ /**
30
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
31
+ *
32
+ * @remarks
33
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { joinPaths } from 'stryke/path';
38
+ *
39
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
40
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
41
+ *
42
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
43
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
44
+ *
45
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
46
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
47
+ *
48
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
49
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
50
+ * ```
51
+ *
52
+ * @param segments - The path segments to join.
53
+ * @returns The joined and normalized path string.
54
+ */
55
+ function joinPaths(...segments) {
56
+ let result = "";
57
+ for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
58
+ if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
59
+ else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
60
+ else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
61
+ }
62
+ return correctPaths(result);
63
+ }
64
+ /**
65
+ * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
66
+ *
67
+ * @param path - The path to normalize.
68
+ * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
69
+ * @returns the normalized path string.
70
+ */
71
+ function normalizeString(path, allowAboveRoot) {
72
+ let res = "";
73
+ let lastSegmentLength = 0;
74
+ let lastSlash = -1;
75
+ let dots = 0;
76
+ let char = null;
77
+ for (let index = 0; index <= path.length; ++index) {
78
+ if (index < path.length) char = path[index];
79
+ else if (char === "/") break;
80
+ else char = "/";
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
83
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
84
+ if (res.length > 2) {
85
+ const lastSlashIndex = res.lastIndexOf("/");
86
+ if (lastSlashIndex === -1) {
87
+ res = "";
88
+ lastSegmentLength = 0;
89
+ } else {
90
+ res = res.slice(0, lastSlashIndex);
91
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
92
+ }
93
+ lastSlash = index;
94
+ dots = 0;
95
+ continue;
96
+ } else if (res.length > 0) {
97
+ res = "";
98
+ lastSegmentLength = 0;
99
+ lastSlash = index;
100
+ dots = 0;
101
+ continue;
102
+ }
103
+ }
104
+ if (allowAboveRoot) {
105
+ res += res.length > 0 ? "/.." : "..";
106
+ lastSegmentLength = 2;
107
+ }
108
+ } else {
109
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
110
+ else res = path.slice(lastSlash + 1, index);
111
+ lastSegmentLength = index - lastSlash - 1;
112
+ }
113
+ lastSlash = index;
114
+ dots = 0;
115
+ } else if (char === "." && dots !== -1) ++dots;
116
+ else dots = -1;
117
+ }
118
+ return res;
119
+ }
120
+
121
+ //#endregion
122
+ export { joinPaths };
123
+ //# sourceMappingURL=join-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths.mjs","names":["char: string | null"],"sources":["../../../../path/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\";\nimport { slash } from \"./slash\";\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 *\n * @remarks\n * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.\n *\n * @example\n * ```ts\n * import { joinPaths } from 'stryke/path';\n *\n * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');\n * console.log(fullPath); // Output: 'folder1/folder3/file.txt'\n *\n * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');\n * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'\n *\n * const windowsPath = joinPaths('C:\\\\', 'Users', 'Public', '..', 'Documents', 'file.txt');\n * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'\n *\n * const uncPath = joinPaths('\\\\\\\\Server\\\\Share', 'Folder', 'File.txt');\n * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'\n * ```\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 result = \"\";\n for (const segment of segments) {\n if (segment && slash(segment).replaceAll(/\\//g, \"\") !== \".\") {\n if (result) {\n if (slash(segment).replaceAll(/\\//g, \"\") === \"..\") {\n result = slash(result)\n .replace(/\\/+$/, \"\")\n .replace(/\\/*[^/]+$/, \"\");\n } else {\n result = `${slash(result).replace(/\\/+$/, \"\")}/${slash(\n segment\n ).replace(/^\\/+/, \"\")}`;\n }\n } else if (slash(segment).replaceAll(/\\//g, \"\") !== \"..\") {\n result = segment;\n }\n }\n }\n\n return correctPaths(result);\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":";;;;;AA2BA,SAAS,qBAAqB,QAAQ,IAAI;AACxC,KAAI,CAAC,MACH,QAAO;AAET,QAAO,MACJ,QAAQ,OAAO,IAAI,CACnB,QAAQ,2BAA0B,MAAK,EAAE,aAAa,CAAC;;AAG5D,SAAS,aAAa,MAAe;AACnC,KAAI,CAAC,QAAQ,KAAK,WAAW,EAC3B,QAAO;AAIT,QAAO,qBAAqB,KAAK;CAEjC,MAAM,YAAY,KAAK,MAAM,UAAU;CACvC,MAAM,iBAAiB,WAAW,KAAK;CACvC,MAAM,oBAAoB,KAAK,KAAK,SAAS,OAAO;AAGpD,QAAO,gBAAgB,MAAM,CAAC,eAAe;AAE7C,KAAI,KAAK,WAAW,GAAG;AACrB,MAAI,eACF,QAAO;AAET,SAAO,oBAAoB,OAAO;;AAEpC,KAAI,kBACF,SAAQ;AAEV,KAAI,mBAAmB,KAAK,KAAK,CAC/B,SAAQ;AAGV,KAAI,WAAW;AACb,MAAI,CAAC,eACH,QAAO,OAAO;AAEhB,SAAO,KAAK;;AAGd,QAAO,kBAAkB,CAAC,WAAW,KAAK,GAAG,IAAI,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6B5D,SAAgB,UAAU,GAAG,UAA4B;CACvD,IAAI,SAAS;AACb,MAAK,MAAM,WAAW,SACpB,KAAI,WAAW,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KACtD;MAAI,OACF,KAAI,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KAC3C,UAAS,MAAM,OAAO,CACnB,QAAQ,QAAQ,GAAG,CACnB,QAAQ,aAAa,GAAG;MAE3B,UAAS,GAAG,MAAM,OAAO,CAAC,QAAQ,QAAQ,GAAG,CAAC,GAAG,MAC/C,QACD,CAAC,QAAQ,QAAQ,GAAG;WAEd,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KAClD,UAAS;;AAKf,QAAO,aAAa,OAAO;;;;;;;;;AAY7B,SAAS,gBAAgB,MAAc,gBAAyB;CAC9D,IAAI,MAAM;CACV,IAAI,oBAAoB;CACxB,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAIA,OAAsB;AAC1B,MAAK,IAAI,QAAQ,GAAG,SAAS,KAAK,QAAQ,EAAE,OAAO;AACjD,MAAI,QAAQ,KAAK,OAEf,QAAO,KAAK;WACH,SAAS,IAClB;MAEA,QAAO;AAET,MAAI,SAAS,KAAK;AAChB,OAAI,cAAc,QAAQ,KAAK,SAAS,GAAG,YAEhC,SAAS,GAAG;AACrB,QACE,IAAI,SAAS,KACb,sBAAsB,KACtB,IAAI,IAAI,SAAS,OAAO,OACxB,IAAI,IAAI,SAAS,OAAO,KAExB;SAAI,IAAI,SAAS,GAAG;MAClB,MAAM,iBAAiB,IAAI,YAAY,IAAI;AAC3C,UAAI,mBAAmB,IAAI;AACzB,aAAM;AACN,2BAAoB;aACf;AACL,aAAM,IAAI,MAAM,GAAG,eAAe;AAClC,2BAAoB,IAAI,SAAS,IAAI,IAAI,YAAY,IAAI;;AAE3D,kBAAY;AACZ,aAAO;AACP;gBACS,IAAI,SAAS,GAAG;AACzB,YAAM;AACN,0BAAoB;AACpB,kBAAY;AACZ,aAAO;AACP;;;AAGJ,QAAI,gBAAgB;AAClB,YAAO,IAAI,SAAS,IAAI,QAAQ;AAChC,yBAAoB;;UAEjB;AACL,QAAI,IAAI,SAAS,EACf,QAAO,IAAI,KAAK,MAAM,YAAY,GAAG,MAAM;QAE3C,OAAM,KAAK,MAAM,YAAY,GAAG,MAAM;AAExC,wBAAoB,QAAQ,YAAY;;AAE1C,eAAY;AACZ,UAAO;aACE,SAAS,OAAO,SAAS,GAClC,GAAE;MAEF,QAAO;;AAGX,QAAO"}
@@ -0,0 +1,12 @@
1
+
2
+ //#region ../path/src/regex.ts
3
+ const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
4
+ const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
5
+ const UNC_REGEX = /^[/\\]{2}/;
6
+ const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
7
+
8
+ //#endregion
9
+ exports.ABSOLUTE_PATH_REGEX = ABSOLUTE_PATH_REGEX;
10
+ exports.DRIVE_LETTER_REGEX = DRIVE_LETTER_REGEX;
11
+ exports.DRIVE_LETTER_START_REGEX = DRIVE_LETTER_START_REGEX;
12
+ exports.UNC_REGEX = UNC_REGEX;
@@ -0,0 +1,9 @@
1
+ //#region ../path/src/regex.ts
2
+ const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
3
+ const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
4
+ const UNC_REGEX = /^[/\\]{2}/;
5
+ const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
6
+
7
+ //#endregion
8
+ export { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX };
9
+ //# sourceMappingURL=regex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.mjs","names":[],"sources":["../../../../path/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;\nexport const FULL_FILE_EXTENSION_REGEX = /(\\.d)?\\.[0-9a-z]+(\\.map)?$/i;\n\nexport const PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nexport const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n"],"mappings":";AAkBA,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAElC,MAAa,YAAY;AAEzB,MAAa,sBACX"}
@@ -0,0 +1,15 @@
1
+
2
+ //#region ../path/src/slash.ts
3
+ /**
4
+ * Replace backslash to slash
5
+ *
6
+ * @param path - The string to replace
7
+ * @returns The string with replaced backslashes
8
+ */
9
+ function slash(path) {
10
+ if (path.startsWith("\\\\?\\")) return path;
11
+ return path.replace(/\\/g, "/");
12
+ }
13
+
14
+ //#endregion
15
+ exports.slash = slash;
@@ -0,0 +1,15 @@
1
+ //#region ../path/src/slash.ts
2
+ /**
3
+ * Replace backslash to slash
4
+ *
5
+ * @param path - The string to replace
6
+ * @returns The string with replaced backslashes
7
+ */
8
+ function slash(path) {
9
+ if (path.startsWith("\\\\?\\")) return path;
10
+ return path.replace(/\\/g, "/");
11
+ }
12
+
13
+ //#endregion
14
+ export { slash };
15
+ //# sourceMappingURL=slash.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash.mjs","names":[],"sources":["../../../../path/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 { 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":";;;;;;;AA0BA,SAAgB,MAAM,MAAc;AAClC,KAAI,KAAK,WAAW,UAAU,CAC5B,QAAO;AAGT,QAAO,KAAK,QAAQ,OAAO,IAAI"}
@@ -0,0 +1,17 @@
1
+ const require_correct_path = require('./path/src/correct-path.cjs');
2
+
3
+ //#region src/pretty-path.ts
4
+ /**
5
+ * Format a file path to be more human-readable by removing the `file://` prefix and optionally converting it to a relative path.
6
+ *
7
+ * @param path - The file path to format.
8
+ * @param options - Optional settings for how the path should be formatted.
9
+ * @returns A human-readable version of the file path, with the `file://` prefix removed and optionally converted to a relative path based on the provided options.
10
+ */
11
+ function prettyPath(path, options = {}) {
12
+ const formatted = path.replace(/^file:\/\//, "");
13
+ return require_correct_path.withoutTrailingSlash(options.relative ? require_correct_path.toRelativePath(formatted, options.cwd) : formatted);
14
+ }
15
+
16
+ //#endregion
17
+ exports.prettyPath = prettyPath;
@@ -0,0 +1,27 @@
1
+ //#region src/pretty-path.d.ts
2
+ interface PrettyPathOptions {
3
+ /**
4
+ * The current working directory to use as the base for the relative path. If not provided, it defaults to `process.cwd()`.
5
+ */
6
+ cwd?: string;
7
+ /**
8
+ * Whether to return a relative path instead of an absolute path.
9
+ *
10
+ * @remarks
11
+ * If `true`, the function will return a path relative to the provided {@link PrettyPathOptions.cwd}.
12
+ *
13
+ * @defaultValue `false`
14
+ */
15
+ relative?: boolean;
16
+ }
17
+ /**
18
+ * Format a file path to be more human-readable by removing the `file://` prefix and optionally converting it to a relative path.
19
+ *
20
+ * @param path - The file path to format.
21
+ * @param options - Optional settings for how the path should be formatted.
22
+ * @returns A human-readable version of the file path, with the `file://` prefix removed and optionally converted to a relative path based on the provided options.
23
+ */
24
+ declare function prettyPath(path: string, options?: PrettyPathOptions): string;
25
+ //#endregion
26
+ export { PrettyPathOptions, prettyPath };
27
+ //# sourceMappingURL=pretty-path.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-path.d.cts","names":[],"sources":["../src/pretty-path.ts"],"sourcesContent":[],"mappings":";UAoBiB,iBAAA;EAAA;AAwBjB;;;;;;;;;;;;;;;;;;;;iBAAgB,UAAA,yBAEL"}
@@ -0,0 +1,27 @@
1
+ //#region src/pretty-path.d.ts
2
+ interface PrettyPathOptions {
3
+ /**
4
+ * The current working directory to use as the base for the relative path. If not provided, it defaults to `process.cwd()`.
5
+ */
6
+ cwd?: string;
7
+ /**
8
+ * Whether to return a relative path instead of an absolute path.
9
+ *
10
+ * @remarks
11
+ * If `true`, the function will return a path relative to the provided {@link PrettyPathOptions.cwd}.
12
+ *
13
+ * @defaultValue `false`
14
+ */
15
+ relative?: boolean;
16
+ }
17
+ /**
18
+ * Format a file path to be more human-readable by removing the `file://` prefix and optionally converting it to a relative path.
19
+ *
20
+ * @param path - The file path to format.
21
+ * @param options - Optional settings for how the path should be formatted.
22
+ * @returns A human-readable version of the file path, with the `file://` prefix removed and optionally converted to a relative path based on the provided options.
23
+ */
24
+ declare function prettyPath(path: string, options?: PrettyPathOptions): string;
25
+ //#endregion
26
+ export { PrettyPathOptions, prettyPath };
27
+ //# sourceMappingURL=pretty-path.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-path.d.mts","names":[],"sources":["../src/pretty-path.ts"],"sourcesContent":[],"mappings":";UAoBiB,iBAAA;EAAA;AAwBjB;;;;;;;;;;;;;;;;;;;;iBAAgB,UAAA,yBAEL"}
@@ -0,0 +1,18 @@
1
+ import { toRelativePath, withoutTrailingSlash } from "./path/src/correct-path.mjs";
2
+
3
+ //#region src/pretty-path.ts
4
+ /**
5
+ * Format a file path to be more human-readable by removing the `file://` prefix and optionally converting it to a relative path.
6
+ *
7
+ * @param path - The file path to format.
8
+ * @param options - Optional settings for how the path should be formatted.
9
+ * @returns A human-readable version of the file path, with the `file://` prefix removed and optionally converted to a relative path based on the provided options.
10
+ */
11
+ function prettyPath(path, options = {}) {
12
+ const formatted = path.replace(/^file:\/\//, "");
13
+ return withoutTrailingSlash(options.relative ? toRelativePath(formatted, options.cwd) : formatted);
14
+ }
15
+
16
+ //#endregion
17
+ export { prettyPath };
18
+ //# sourceMappingURL=pretty-path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-path.mjs","names":[],"sources":["../src/pretty-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 { toRelativePath, withoutTrailingSlash } from \"@stryke/path/normalize\";\n\nexport interface PrettyPathOptions {\n /**\n * The current working directory to use as the base for the relative path. If not provided, it defaults to `process.cwd()`.\n */\n cwd?: string;\n\n /**\n * Whether to return a relative path instead of an absolute path.\n *\n * @remarks\n * If `true`, the function will return a path relative to the provided {@link PrettyPathOptions.cwd}.\n *\n * @defaultValue `false`\n */\n relative?: boolean;\n}\n\n/**\n * Format a file path to be more human-readable by removing the `file://` prefix and optionally converting it to a relative path.\n *\n * @param path - The file path to format.\n * @param options - Optional settings for how the path should be formatted.\n * @returns A human-readable version of the file path, with the `file://` prefix removed and optionally converted to a relative path based on the provided options.\n */\nexport function prettyPath(\n path: string,\n options: PrettyPathOptions = {}\n): string {\n const formatted = path.replace(/^file:\\/\\//, \"\");\n\n return withoutTrailingSlash(\n options.relative ? toRelativePath(formatted, options.cwd) : formatted\n );\n}\n"],"mappings":";;;;;;;;;;AA4CA,SAAgB,WACd,MACA,UAA6B,EAAE,EACvB;CACR,MAAM,YAAY,KAAK,QAAQ,cAAc,GAAG;AAEhD,QAAO,qBACL,QAAQ,WAAW,eAAe,WAAW,QAAQ,IAAI,GAAG,UAC7D"}
@@ -1,3 +1,4 @@
1
+ const require_acronyms = require('./acronyms.cjs');
1
2
  const require_combine = require('./combine.cjs');
2
3
  const require_upper_case_first = require('./upper-case-first.cjs');
3
4
  const require_decamelize = require('./decamelize.cjs');
@@ -12,7 +13,7 @@ const require_format_special_cases = require('./format-special-cases.cjs');
12
13
  * @returns The title cased string.
13
14
  */
14
15
  function titleCase(input, options) {
15
- return input?.split(/\s+-\s+/).map((segment) => require_decamelize.decamelize(segment).split(/[\s\-_]/).map(require_upper_case_first.upperCaseFirst).map((value, index, array) => require_format_special_cases.formatSpecialCases(value, index, array, options)).reduce(require_combine.combine)).join(" - ");
16
+ return input?.split(/\s+-\s+/).map((segment) => require_decamelize.decamelize(segment).split(/[\s\-_]/).map(require_upper_case_first.upperCaseFirst).map((value) => options?.expandAcronyms ? require_acronyms.ACRONYMS[value]?.description || value : value).map((value, index, array) => require_format_special_cases.formatSpecialCases(value, index, array, options)).reduce(require_combine.combine)).join(" - ");
16
17
  }
17
18
 
18
19
  //#endregion
@@ -1,7 +1,17 @@
1
1
  import { FormatSpecialCasesOptions } from "./format-special-cases.cjs";
2
2
 
3
3
  //#region src/title-case.d.ts
4
-
4
+ interface TitleCaseOptions extends FormatSpecialCasesOptions {
5
+ /**
6
+ * Whether to expand acronyms in the input string.
7
+ *
8
+ * @remarks
9
+ * If true, acronyms will be expanded to their full form before being converted to title case. For example, "NASA" would be expanded to "National Aeronautics and Space Administration".
10
+ *
11
+ * @defaultValue false
12
+ */
13
+ expandAcronyms?: boolean;
14
+ }
5
15
  /**
6
16
  * Convert a string to title case.
7
17
  *
@@ -9,7 +19,7 @@ import { FormatSpecialCasesOptions } from "./format-special-cases.cjs";
9
19
  * @param options - Options for formatting special cases.
10
20
  * @returns The title cased string.
11
21
  */
12
- declare function titleCase<T extends string | undefined>(input: T, options?: FormatSpecialCasesOptions): T;
22
+ declare function titleCase<T extends string | undefined>(input: T, options?: TitleCaseOptions): T;
13
23
  //#endregion
14
- export { titleCase };
24
+ export { TitleCaseOptions, titleCase };
15
25
  //# sourceMappingURL=title-case.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"title-case.d.cts","names":[],"sources":["../src/title-case.ts"],"sourcesContent":[],"mappings":";;;;;;AA+BA;;;;;iBAAgB,+CACP,aACG,4BACT"}
1
+ {"version":3,"file":"title-case.d.cts","names":[],"sources":["../src/title-case.ts"],"sourcesContent":[],"mappings":";;;UAyBiB,gBAAA,SAAyB;;AAA1C;AAmBA;;;;;;;;;;;;;;;iBAAgB,+CACP,aACG,mBACT"}
@@ -1,7 +1,17 @@
1
1
  import { FormatSpecialCasesOptions } from "./format-special-cases.mjs";
2
2
 
3
3
  //#region src/title-case.d.ts
4
-
4
+ interface TitleCaseOptions extends FormatSpecialCasesOptions {
5
+ /**
6
+ * Whether to expand acronyms in the input string.
7
+ *
8
+ * @remarks
9
+ * If true, acronyms will be expanded to their full form before being converted to title case. For example, "NASA" would be expanded to "National Aeronautics and Space Administration".
10
+ *
11
+ * @defaultValue false
12
+ */
13
+ expandAcronyms?: boolean;
14
+ }
5
15
  /**
6
16
  * Convert a string to title case.
7
17
  *
@@ -9,7 +19,7 @@ import { FormatSpecialCasesOptions } from "./format-special-cases.mjs";
9
19
  * @param options - Options for formatting special cases.
10
20
  * @returns The title cased string.
11
21
  */
12
- declare function titleCase<T extends string | undefined>(input: T, options?: FormatSpecialCasesOptions): T;
22
+ declare function titleCase<T extends string | undefined>(input: T, options?: TitleCaseOptions): T;
13
23
  //#endregion
14
- export { titleCase };
24
+ export { TitleCaseOptions, titleCase };
15
25
  //# sourceMappingURL=title-case.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"title-case.d.mts","names":[],"sources":["../src/title-case.ts"],"sourcesContent":[],"mappings":";;;;;;AA+BA;;;;;iBAAgB,+CACP,aACG,4BACT"}
1
+ {"version":3,"file":"title-case.d.mts","names":[],"sources":["../src/title-case.ts"],"sourcesContent":[],"mappings":";;;UAyBiB,gBAAA,SAAyB;;AAA1C;AAmBA;;;;;;;;;;;;;;;iBAAgB,+CACP,aACG,mBACT"}
@@ -1,3 +1,4 @@
1
+ import { ACRONYMS } from "./acronyms.mjs";
1
2
  import { combine } from "./combine.mjs";
2
3
  import { upperCaseFirst } from "./upper-case-first.mjs";
3
4
  import { decamelize } from "./decamelize.mjs";
@@ -12,7 +13,7 @@ import { formatSpecialCases } from "./format-special-cases.mjs";
12
13
  * @returns The title cased string.
13
14
  */
14
15
  function titleCase(input, options) {
15
- return input?.split(/\s+-\s+/).map((segment) => decamelize(segment).split(/[\s\-_]/).map(upperCaseFirst).map((value, index, array) => formatSpecialCases(value, index, array, options)).reduce(combine)).join(" - ");
16
+ return input?.split(/\s+-\s+/).map((segment) => decamelize(segment).split(/[\s\-_]/).map(upperCaseFirst).map((value) => options?.expandAcronyms ? ACRONYMS[value]?.description || value : value).map((value, index, array) => formatSpecialCases(value, index, array, options)).reduce(combine)).join(" - ");
16
17
  }
17
18
 
18
19
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"title-case.mjs","names":[],"sources":["../src/title-case.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 { combine } from \"./combine\";\nimport { decamelize } from \"./decamelize\";\nimport type { FormatSpecialCasesOptions } from \"./format-special-cases\";\nimport { formatSpecialCases } from \"./format-special-cases\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\n/**\n * Convert a string to title case.\n *\n * @param input - The input string to convert.\n * @param options - Options for formatting special cases.\n * @returns The title cased string.\n */\nexport function titleCase<T extends string | undefined>(\n input: T,\n options?: FormatSpecialCasesOptions\n): T {\n return input\n ?.split(/\\s+-\\s+/)\n .map(segment =>\n decamelize(segment)\n .split(/[\\s\\-_]/)\n .map(upperCaseFirst)\n .map((value: string, index: number, array: string[]) =>\n formatSpecialCases(value, index, array, options)\n )\n .reduce(combine)\n )\n .join(\" - \") as T;\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,UACd,OACA,SACG;AACH,QAAO,OACH,MAAM,UAAU,CACjB,KAAI,YACH,WAAW,QAAQ,CAChB,MAAM,UAAU,CAChB,IAAI,eAAe,CACnB,KAAK,OAAe,OAAe,UAClC,mBAAmB,OAAO,OAAO,OAAO,QAAQ,CACjD,CACA,OAAO,QAAQ,CACnB,CACA,KAAK,MAAM"}
1
+ {"version":3,"file":"title-case.mjs","names":[],"sources":["../src/title-case.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 { ACRONYMS } from \"./acronyms\";\nimport { combine } from \"./combine\";\nimport { decamelize } from \"./decamelize\";\nimport type { FormatSpecialCasesOptions } from \"./format-special-cases\";\nimport { formatSpecialCases } from \"./format-special-cases\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\nexport interface TitleCaseOptions extends FormatSpecialCasesOptions {\n /**\n * Whether to expand acronyms in the input string.\n *\n * @remarks\n * If true, acronyms will be expanded to their full form before being converted to title case. For example, \"NASA\" would be expanded to \"National Aeronautics and Space Administration\".\n *\n * @defaultValue false\n */\n expandAcronyms?: boolean;\n}\n\n/**\n * Convert a string to title case.\n *\n * @param input - The input string to convert.\n * @param options - Options for formatting special cases.\n * @returns The title cased string.\n */\nexport function titleCase<T extends string | undefined>(\n input: T,\n options?: TitleCaseOptions\n): T {\n return input\n ?.split(/\\s+-\\s+/)\n .map(segment =>\n decamelize(segment)\n .split(/[\\s\\-_]/)\n .map(upperCaseFirst)\n .map(value =>\n options?.expandAcronyms\n ? ACRONYMS[value]?.description || value\n : value\n )\n .map((value: string, index: number, array: string[]) =>\n formatSpecialCases(value, index, array, options)\n )\n .reduce(combine)\n )\n .join(\" - \") as T;\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,SAAgB,UACd,OACA,SACG;AACH,QAAO,OACH,MAAM,UAAU,CACjB,KAAI,YACH,WAAW,QAAQ,CAChB,MAAM,UAAU,CAChB,IAAI,eAAe,CACnB,KAAI,UACH,SAAS,iBACL,SAAS,QAAQ,eAAe,QAChC,MACL,CACA,KAAK,OAAe,OAAe,UAClC,mBAAmB,OAAO,OAAO,OAAO,QAAQ,CACjD,CACA,OAAO,QAAQ,CACnB,CACA,KAAK,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/string-format",
3
- "version": "0.14.8",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "description": "A package containing utility functions to transform strings into various formats.",
6
6
  "repository": {
@@ -61,6 +61,7 @@
61
61
  "require": "./dist/kebab-case.cjs",
62
62
  "import": "./dist/kebab-case.mjs"
63
63
  },
64
+ "./list": { "require": "./dist/list.cjs", "import": "./dist/list.mjs" },
64
65
  "./lower-case-first": {
65
66
  "require": "./dist/lower-case-first.cjs",
66
67
  "import": "./dist/lower-case-first.mjs"
@@ -94,6 +95,10 @@
94
95
  "require": "./dist/pretty-bytes.cjs",
95
96
  "import": "./dist/pretty-bytes.mjs"
96
97
  },
98
+ "./pretty-path": {
99
+ "require": "./dist/pretty-path.cjs",
100
+ "import": "./dist/pretty-path.mjs"
101
+ },
97
102
  "./snake-case": {
98
103
  "require": "./dist/snake-case.cjs",
99
104
  "import": "./dist/snake-case.mjs"
@@ -129,7 +134,8 @@
129
134
  "./*": "./*"
130
135
  },
131
136
  "types": "./dist/index.d.cts",
137
+ "dependencies": { "@stryke/path": "^0.26.15" },
132
138
  "devDependencies": { "tsdown": "^0.17.2" },
133
139
  "publishConfig": { "access": "public" },
134
- "gitHead": "7d12d78184a0812114d762186fe34f82d9e9083d"
140
+ "gitHead": "6e83233262e8614cd725c601173e20c877d4c60d"
135
141
  }