@stryke/env 0.20.49 → 0.20.51

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 (77) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -1
  3. package/dist/ci-checks.cjs +23 -1
  4. package/dist/ci-checks.mjs +21 -1
  5. package/dist/ci-checks.mjs.map +1 -1
  6. package/dist/convert/src/to-array.cjs +15 -1
  7. package/dist/convert/src/to-array.mjs +14 -1
  8. package/dist/convert/src/to-array.mjs.map +1 -1
  9. package/dist/environment-checks.cjs +156 -1
  10. package/dist/environment-checks.mjs +139 -1
  11. package/dist/environment-checks.mjs.map +1 -1
  12. package/dist/fs/src/exists.cjs +17 -1
  13. package/dist/fs/src/exists.mjs +15 -1
  14. package/dist/fs/src/exists.mjs.map +1 -1
  15. package/dist/fs/src/read-file.cjs +17 -1
  16. package/dist/fs/src/read-file.mjs +16 -1
  17. package/dist/fs/src/read-file.mjs.map +1 -1
  18. package/dist/get-env-paths.cjs +87 -1
  19. package/dist/get-env-paths.mjs +84 -1
  20. package/dist/get-env-paths.mjs.map +1 -1
  21. package/dist/index.cjs +48 -1
  22. package/dist/index.mjs +9 -1
  23. package/dist/load-env.cjs +124 -1
  24. package/dist/load-env.mjs +118 -1
  25. package/dist/load-env.mjs.map +1 -1
  26. package/dist/path/src/is-type.cjs +28 -1
  27. package/dist/path/src/is-type.mjs +28 -1
  28. package/dist/path/src/is-type.mjs.map +1 -1
  29. package/dist/path/src/join-paths.cjs +106 -1
  30. package/dist/path/src/join-paths.mjs +106 -1
  31. package/dist/path/src/join-paths.mjs.map +1 -1
  32. package/dist/path/src/regex.cjs +12 -1
  33. package/dist/path/src/regex.mjs +8 -1
  34. package/dist/path/src/regex.mjs.map +1 -1
  35. package/dist/path/src/slash.cjs +15 -1
  36. package/dist/path/src/slash.mjs +14 -1
  37. package/dist/path/src/slash.mjs.map +1 -1
  38. package/dist/providers.cjs +112 -1
  39. package/dist/providers.mjs +110 -1
  40. package/dist/providers.mjs.map +1 -1
  41. package/dist/runtime-checks.cjs +71 -1
  42. package/dist/runtime-checks.mjs +60 -1
  43. package/dist/runtime-checks.mjs.map +1 -1
  44. package/dist/string-format/src/acronyms.cjs +408 -1
  45. package/dist/string-format/src/acronyms.mjs +407 -1
  46. package/dist/string-format/src/acronyms.mjs.map +1 -1
  47. package/dist/string-format/src/articles.cjs +10 -1
  48. package/dist/string-format/src/articles.mjs +9 -1
  49. package/dist/string-format/src/articles.mjs.map +1 -1
  50. package/dist/string-format/src/combine.cjs +15 -1
  51. package/dist/string-format/src/combine.mjs +14 -1
  52. package/dist/string-format/src/combine.mjs.map +1 -1
  53. package/dist/string-format/src/conjunctions.cjs +32 -1
  54. package/dist/string-format/src/conjunctions.mjs +31 -1
  55. package/dist/string-format/src/conjunctions.mjs.map +1 -1
  56. package/dist/string-format/src/decamelize.cjs +14 -1
  57. package/dist/string-format/src/decamelize.mjs +13 -1
  58. package/dist/string-format/src/decamelize.mjs.map +1 -1
  59. package/dist/string-format/src/format-special-cases.cjs +33 -1
  60. package/dist/string-format/src/format-special-cases.mjs +33 -1
  61. package/dist/string-format/src/format-special-cases.mjs.map +1 -1
  62. package/dist/string-format/src/prepositions.cjs +68 -1
  63. package/dist/string-format/src/prepositions.mjs +67 -1
  64. package/dist/string-format/src/prepositions.mjs.map +1 -1
  65. package/dist/string-format/src/special-cases.cjs +53 -1
  66. package/dist/string-format/src/special-cases.mjs +52 -1
  67. package/dist/string-format/src/special-cases.mjs.map +1 -1
  68. package/dist/string-format/src/title-case.cjs +19 -1
  69. package/dist/string-format/src/title-case.mjs +19 -1
  70. package/dist/string-format/src/title-case.mjs.map +1 -1
  71. package/dist/string-format/src/upper-case-first.cjs +17 -1
  72. package/dist/string-format/src/upper-case-first.mjs +16 -1
  73. package/dist/string-format/src/upper-case-first.mjs.map +1 -1
  74. package/dist/types.cjs +13 -1
  75. package/dist/types.mjs +12 -1
  76. package/dist/types.mjs.map +1 -1
  77. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"articles.mjs","names":[],"sources":["../../../../string-format/src/articles.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 ARTICLES = [\"a\", \"an\", \"the\"];\n"],"mappings":"AAkBA,MAAa,EAAW,CAAC,IAAK,KAAM,MAAM"}
1
+ {"version":3,"file":"articles.mjs","names":[],"sources":["../../../../string-format/src/articles.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 ARTICLES = [\"a\", \"an\", \"the\"];\n"],"mappings":";AAkBA,MAAa,WAAW;CAAC;CAAK;CAAM;CAAM"}
@@ -1 +1,15 @@
1
- function e(e,t){return`${e} ${t}`}exports.combine=e;
1
+
2
+ //#region ../string-format/src/combine.ts
3
+ /**
4
+ * Combine two strings with a space in between.
5
+ *
6
+ * @param acc - The accumulated string.
7
+ * @param str - The string to add.
8
+ * @returns The combined string.
9
+ */
10
+ function combine(acc, str) {
11
+ return `${acc} ${str}`;
12
+ }
13
+
14
+ //#endregion
15
+ exports.combine = combine;
@@ -1,2 +1,15 @@
1
- function e(e,t){return`${e} ${t}`}export{e as combine};
1
+ //#region ../string-format/src/combine.ts
2
+ /**
3
+ * Combine two strings with a space in between.
4
+ *
5
+ * @param acc - The accumulated string.
6
+ * @param str - The string to add.
7
+ * @returns The combined string.
8
+ */
9
+ function combine(acc, str) {
10
+ return `${acc} ${str}`;
11
+ }
12
+
13
+ //#endregion
14
+ export { combine };
2
15
  //# sourceMappingURL=combine.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"combine.mjs","names":[],"sources":["../../../../string-format/src/combine.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 * Combine two strings with a space in between.\n *\n * @param acc - The accumulated string.\n * @param str - The string to add.\n * @returns The combined string.\n */\nexport function combine(acc: string, str: string): string {\n return `${acc} ${str}`;\n}\n"],"mappings":"AAyBA,SAAgB,EAAQ,EAAa,EAAqB,CACxD,MAAO,GAAG,EAAI,GAAG"}
1
+ {"version":3,"file":"combine.mjs","names":[],"sources":["../../../../string-format/src/combine.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 * Combine two strings with a space in between.\n *\n * @param acc - The accumulated string.\n * @param str - The string to add.\n * @returns The combined string.\n */\nexport function combine(acc: string, str: string): string {\n return `${acc} ${str}`;\n}\n"],"mappings":";;;;;;;;AAyBA,SAAgB,QAAQ,KAAa,KAAqB;AACxD,QAAO,GAAG,IAAI,GAAG"}
@@ -1 +1,32 @@
1
- const e=[`and`,`that`,`but`,`or`,`as`,`if`,`when`,`than`,`because`,`while`,`where`,`after`,`so`,`though`,`since`,`until`,`whether`,`before`,`although`,`nor`,`like`,`once`,`unless`,`now`,`except`];exports.CONJUNCTIONS=e;
1
+
2
+ //#region ../string-format/src/conjunctions.ts
3
+ const CONJUNCTIONS = [
4
+ "and",
5
+ "that",
6
+ "but",
7
+ "or",
8
+ "as",
9
+ "if",
10
+ "when",
11
+ "than",
12
+ "because",
13
+ "while",
14
+ "where",
15
+ "after",
16
+ "so",
17
+ "though",
18
+ "since",
19
+ "until",
20
+ "whether",
21
+ "before",
22
+ "although",
23
+ "nor",
24
+ "like",
25
+ "once",
26
+ "unless",
27
+ "now",
28
+ "except"
29
+ ];
30
+
31
+ //#endregion
32
+ exports.CONJUNCTIONS = CONJUNCTIONS;
@@ -1,2 +1,32 @@
1
- const e=[`and`,`that`,`but`,`or`,`as`,`if`,`when`,`than`,`because`,`while`,`where`,`after`,`so`,`though`,`since`,`until`,`whether`,`before`,`although`,`nor`,`like`,`once`,`unless`,`now`,`except`];export{e as CONJUNCTIONS};
1
+ //#region ../string-format/src/conjunctions.ts
2
+ const CONJUNCTIONS = [
3
+ "and",
4
+ "that",
5
+ "but",
6
+ "or",
7
+ "as",
8
+ "if",
9
+ "when",
10
+ "than",
11
+ "because",
12
+ "while",
13
+ "where",
14
+ "after",
15
+ "so",
16
+ "though",
17
+ "since",
18
+ "until",
19
+ "whether",
20
+ "before",
21
+ "although",
22
+ "nor",
23
+ "like",
24
+ "once",
25
+ "unless",
26
+ "now",
27
+ "except"
28
+ ];
29
+
30
+ //#endregion
31
+ export { CONJUNCTIONS };
2
32
  //# sourceMappingURL=conjunctions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"conjunctions.mjs","names":[],"sources":["../../../../string-format/src/conjunctions.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 CONJUNCTIONS = [\n \"and\",\n \"that\",\n \"but\",\n \"or\",\n \"as\",\n \"if\",\n \"when\",\n \"than\",\n \"because\",\n \"while\",\n \"where\",\n \"after\",\n \"so\",\n \"though\",\n \"since\",\n \"until\",\n \"whether\",\n \"before\",\n \"although\",\n \"nor\",\n \"like\",\n \"once\",\n \"unless\",\n \"now\",\n \"except\"\n];\n"],"mappings":"AAkBA,MAAa,EAAe,CAC1B,MACA,OACA,MACA,KACA,KACA,KACA,OACA,OACA,UACA,QACA,QACA,QACA,KACA,SACA,QACA,QACA,UACA,SACA,WACA,MACA,OACA,OACA,SACA,MACA,SACD"}
1
+ {"version":3,"file":"conjunctions.mjs","names":[],"sources":["../../../../string-format/src/conjunctions.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 CONJUNCTIONS = [\n \"and\",\n \"that\",\n \"but\",\n \"or\",\n \"as\",\n \"if\",\n \"when\",\n \"than\",\n \"because\",\n \"while\",\n \"where\",\n \"after\",\n \"so\",\n \"though\",\n \"since\",\n \"until\",\n \"whether\",\n \"before\",\n \"although\",\n \"nor\",\n \"like\",\n \"once\",\n \"unless\",\n \"now\",\n \"except\"\n];\n"],"mappings":";AAkBA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1 +1,14 @@
1
- function e(e){return e.replace(/([a-z\d])([A-Z])/g,`$1_$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1_$2`).toLowerCase()}exports.decamelize=e;
1
+
2
+ //#region ../string-format/src/decamelize.ts
3
+ /**
4
+ * Convert a camelCase or PascalCase string to a snake_case string.
5
+ *
6
+ * @param value - The camelCase or PascalCase string to convert.
7
+ * @returns The converted snake_case string.
8
+ */
9
+ function decamelize(value) {
10
+ return value.replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1_$2").toLowerCase();
11
+ }
12
+
13
+ //#endregion
14
+ exports.decamelize = decamelize;
@@ -1,2 +1,14 @@
1
- function e(e){return e.replace(/([a-z\d])([A-Z])/g,`$1_$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1_$2`).toLowerCase()}export{e as decamelize};
1
+ //#region ../string-format/src/decamelize.ts
2
+ /**
3
+ * Convert a camelCase or PascalCase string to a snake_case string.
4
+ *
5
+ * @param value - The camelCase or PascalCase string to convert.
6
+ * @returns The converted snake_case string.
7
+ */
8
+ function decamelize(value) {
9
+ return value.replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1_$2").toLowerCase();
10
+ }
11
+
12
+ //#endregion
13
+ export { decamelize };
2
14
  //# sourceMappingURL=decamelize.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"decamelize.mjs","names":[],"sources":["../../../../string-format/src/decamelize.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 * Convert a camelCase or PascalCase string to a snake_case string.\n *\n * @param value - The camelCase or PascalCase string to convert.\n * @returns The converted snake_case string.\n */\nexport function decamelize(value: string): string {\n return value\n .replace(/([a-z\\d])([A-Z])/g, \"$1_$2\")\n .replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, \"$1_$2\")\n .toLowerCase();\n}\n"],"mappings":"AAwBA,SAAgB,EAAW,EAAuB,CAChD,OAAO,EACJ,QAAQ,oBAAqB,QAAQ,CACrC,QAAQ,2BAA4B,QAAQ,CAC5C,aAAa"}
1
+ {"version":3,"file":"decamelize.mjs","names":[],"sources":["../../../../string-format/src/decamelize.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 * Convert a camelCase or PascalCase string to a snake_case string.\n *\n * @param value - The camelCase or PascalCase string to convert.\n * @returns The converted snake_case string.\n */\nexport function decamelize(value: string): string {\n return value\n .replace(/([a-z\\d])([A-Z])/g, \"$1_$2\")\n .replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, \"$1_$2\")\n .toLowerCase();\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,WAAW,OAAuB;AAChD,QAAO,MACJ,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,4BAA4B,QAAQ,CAC5C,aAAa"}
@@ -1 +1,33 @@
1
- const e=require(`./acronyms.cjs`),t=require(`./articles.cjs`),n=require(`./conjunctions.cjs`),r=require(`./prepositions.cjs`),i=require(`./special-cases.cjs`);function a(a,o,s,c){let l=a.toLowerCase(),u=a.toUpperCase();for(let e of i.SPECIAL_CASES)if(e.toLowerCase()===l)return e;return e.ACRONYMS[u]?c?.useDescriptions===!1?e.ACRONYMS[u].display||u:e.ACRONYMS[u].description:o===0||o===s.length-1||a.length>=4?a:r.PREPOSITIONS.includes(l)||n.CONJUNCTIONS.includes(l)||t.ARTICLES.includes(l)?l:a}exports.formatSpecialCases=a;
1
+ const require_acronyms = require('./acronyms.cjs');
2
+ const require_articles = require('./articles.cjs');
3
+ const require_conjunctions = require('./conjunctions.cjs');
4
+ const require_prepositions = require('./prepositions.cjs');
5
+ const require_special_cases = require('./special-cases.cjs');
6
+
7
+ //#region ../string-format/src/format-special-cases.ts
8
+ /**
9
+ * Handle special words in a title.
10
+ *
11
+ * @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
12
+ *
13
+ * @param value - The word to handle
14
+ * @param index - The index of the word in the title
15
+ * @param words - The full title as an array of words
16
+ * @returns The formatted word
17
+ */
18
+ function formatSpecialCases(value, index, words, options) {
19
+ const lowercaseStr = value.toLowerCase();
20
+ const uppercaseStr = value.toUpperCase();
21
+ for (const special of require_special_cases.SPECIAL_CASES) if (special.toLowerCase() === lowercaseStr) return special;
22
+ if (require_acronyms.ACRONYMS[uppercaseStr]) return options?.useDescriptions !== false ? require_acronyms.ACRONYMS[uppercaseStr].description : require_acronyms.ACRONYMS[uppercaseStr].display || uppercaseStr;
23
+ if (index === 0) return value;
24
+ if (index === words.length - 1) return value;
25
+ if (value.length >= 4) return value;
26
+ if (require_prepositions.PREPOSITIONS.includes(lowercaseStr)) return lowercaseStr;
27
+ if (require_conjunctions.CONJUNCTIONS.includes(lowercaseStr)) return lowercaseStr;
28
+ if (require_articles.ARTICLES.includes(lowercaseStr)) return lowercaseStr;
29
+ return value;
30
+ }
31
+
32
+ //#endregion
33
+ exports.formatSpecialCases = formatSpecialCases;
@@ -1,2 +1,34 @@
1
- import{ACRONYMS as e}from"./acronyms.mjs";import{ARTICLES as t}from"./articles.mjs";import{CONJUNCTIONS as n}from"./conjunctions.mjs";import{PREPOSITIONS as r}from"./prepositions.mjs";import{SPECIAL_CASES as i}from"./special-cases.mjs";function a(a,o,s,c){let l=a.toLowerCase(),u=a.toUpperCase();for(let e of i)if(e.toLowerCase()===l)return e;return e[u]?c?.useDescriptions===!1?e[u].display||u:e[u].description:o===0||o===s.length-1||a.length>=4?a:r.includes(l)||n.includes(l)||t.includes(l)?l:a}export{a as formatSpecialCases};
1
+ import { ACRONYMS } from "./acronyms.mjs";
2
+ import { ARTICLES } from "./articles.mjs";
3
+ import { CONJUNCTIONS } from "./conjunctions.mjs";
4
+ import { PREPOSITIONS } from "./prepositions.mjs";
5
+ import { SPECIAL_CASES } from "./special-cases.mjs";
6
+
7
+ //#region ../string-format/src/format-special-cases.ts
8
+ /**
9
+ * Handle special words in a title.
10
+ *
11
+ * @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
12
+ *
13
+ * @param value - The word to handle
14
+ * @param index - The index of the word in the title
15
+ * @param words - The full title as an array of words
16
+ * @returns The formatted word
17
+ */
18
+ function formatSpecialCases(value, index, words, options) {
19
+ const lowercaseStr = value.toLowerCase();
20
+ const uppercaseStr = value.toUpperCase();
21
+ for (const special of SPECIAL_CASES) if (special.toLowerCase() === lowercaseStr) return special;
22
+ if (ACRONYMS[uppercaseStr]) return options?.useDescriptions !== false ? ACRONYMS[uppercaseStr].description : ACRONYMS[uppercaseStr].display || uppercaseStr;
23
+ if (index === 0) return value;
24
+ if (index === words.length - 1) return value;
25
+ if (value.length >= 4) return value;
26
+ if (PREPOSITIONS.includes(lowercaseStr)) return lowercaseStr;
27
+ if (CONJUNCTIONS.includes(lowercaseStr)) return lowercaseStr;
28
+ if (ARTICLES.includes(lowercaseStr)) return lowercaseStr;
29
+ return value;
30
+ }
31
+
32
+ //#endregion
33
+ export { formatSpecialCases };
2
34
  //# sourceMappingURL=format-special-cases.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-special-cases.mjs","names":[],"sources":["../../../../string-format/src/format-special-cases.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 { ARTICLES } from \"./articles\";\nimport { CONJUNCTIONS } from \"./conjunctions\";\nimport { PREPOSITIONS } from \"./prepositions\";\nimport { SPECIAL_CASES } from \"./special-cases\";\n\nexport interface FormatSpecialCasesOptions {\n /**\n * If true, use the descriptions from the acronym list instead of the display names.\n *\n * @defaultValue true\n */\n useDescriptions?: boolean;\n}\n\n/**\n * Handle special words in a title.\n *\n * @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case\n *\n * @param value - The word to handle\n * @param index - The index of the word in the title\n * @param words - The full title as an array of words\n * @returns The formatted word\n */\nexport function formatSpecialCases(\n value: string,\n index: number,\n words: string[],\n options?: FormatSpecialCasesOptions\n): string {\n const lowercaseStr = value.toLowerCase();\n const uppercaseStr = value.toUpperCase();\n\n for (const special of SPECIAL_CASES) {\n if (special.toLowerCase() === lowercaseStr) {\n return special;\n }\n }\n\n if (ACRONYMS[uppercaseStr]) {\n return options?.useDescriptions !== false\n ? ACRONYMS[uppercaseStr].description\n : ACRONYMS[uppercaseStr].display || uppercaseStr;\n }\n\n // If the word is the first word in the sentence, but it's not a specially\n // cased word or an acronym, return the capitalized string\n if (index === 0) {\n return value;\n }\n\n // If the word is the last word in the sentence, but it's not a specially\n // cased word or an acronym, return the capitalized string\n if (index === words.length - 1) {\n return value;\n }\n\n // Return the word capitalized if it's 4 characters or more\n if (value.length >= 4) {\n return value;\n }\n\n if (PREPOSITIONS.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n if (CONJUNCTIONS.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n if (ARTICLES.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n\n return value;\n}\n"],"mappings":"4OA2CA,SAAgB,EACd,EACA,EACA,EACA,EACQ,CACR,IAAM,EAAe,EAAM,aAAa,CAClC,EAAe,EAAM,aAAa,CAExC,IAAK,IAAM,KAAW,EACpB,GAAI,EAAQ,aAAa,GAAK,EAC5B,OAAO,EAqCX,OAjCI,EAAS,GACJ,GAAS,kBAAoB,GAEhC,EAAS,GAAc,SAAW,EADlC,EAAS,GAAc,YAMzB,IAAU,GAMV,IAAU,EAAM,OAAS,GAKzB,EAAM,QAAU,EACX,EAGL,EAAa,SAAS,EAAa,EAGnC,EAAa,SAAS,EAAa,EAGnC,EAAS,SAAS,EAAa,CAC1B,EAGF"}
1
+ {"version":3,"file":"format-special-cases.mjs","names":[],"sources":["../../../../string-format/src/format-special-cases.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 { ARTICLES } from \"./articles\";\nimport { CONJUNCTIONS } from \"./conjunctions\";\nimport { PREPOSITIONS } from \"./prepositions\";\nimport { SPECIAL_CASES } from \"./special-cases\";\n\nexport interface FormatSpecialCasesOptions {\n /**\n * If true, use the descriptions from the acronym list instead of the display names.\n *\n * @defaultValue true\n */\n useDescriptions?: boolean;\n}\n\n/**\n * Handle special words in a title.\n *\n * @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case\n *\n * @param value - The word to handle\n * @param index - The index of the word in the title\n * @param words - The full title as an array of words\n * @returns The formatted word\n */\nexport function formatSpecialCases(\n value: string,\n index: number,\n words: string[],\n options?: FormatSpecialCasesOptions\n): string {\n const lowercaseStr = value.toLowerCase();\n const uppercaseStr = value.toUpperCase();\n\n for (const special of SPECIAL_CASES) {\n if (special.toLowerCase() === lowercaseStr) {\n return special;\n }\n }\n\n if (ACRONYMS[uppercaseStr]) {\n return options?.useDescriptions !== false\n ? ACRONYMS[uppercaseStr].description\n : ACRONYMS[uppercaseStr].display || uppercaseStr;\n }\n\n // If the word is the first word in the sentence, but it's not a specially\n // cased word or an acronym, return the capitalized string\n if (index === 0) {\n return value;\n }\n\n // If the word is the last word in the sentence, but it's not a specially\n // cased word or an acronym, return the capitalized string\n if (index === words.length - 1) {\n return value;\n }\n\n // Return the word capitalized if it's 4 characters or more\n if (value.length >= 4) {\n return value;\n }\n\n if (PREPOSITIONS.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n if (CONJUNCTIONS.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n if (ARTICLES.includes(lowercaseStr)) {\n return lowercaseStr;\n }\n\n return value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,SAAgB,mBACd,OACA,OACA,OACA,SACQ;CACR,MAAM,eAAe,MAAM,aAAa;CACxC,MAAM,eAAe,MAAM,aAAa;AAExC,MAAK,MAAM,WAAW,cACpB,KAAI,QAAQ,aAAa,KAAK,aAC5B,QAAO;AAIX,KAAI,SAAS,cACX,QAAO,SAAS,oBAAoB,QAChC,SAAS,cAAc,cACvB,SAAS,cAAc,WAAW;AAKxC,KAAI,UAAU,EACZ,QAAO;AAKT,KAAI,UAAU,MAAM,SAAS,EAC3B,QAAO;AAIT,KAAI,MAAM,UAAU,EAClB,QAAO;AAGT,KAAI,aAAa,SAAS,aAAa,CACrC,QAAO;AAET,KAAI,aAAa,SAAS,aAAa,CACrC,QAAO;AAET,KAAI,SAAS,SAAS,aAAa,CACjC,QAAO;AAGT,QAAO"}
@@ -1 +1,68 @@
1
- const e=`about.above.across.after.against.along.among.around.at.because of.before.behind.below.beneath.beside.besides.between.beyond.but.by.concerning.despite.down.during.except.excepting.for.from.in.in front of.inside.in spite of.instead of.into.like.near.of.off.on.onto.out.outside.over.past.regarding.since.through.throughout.to.toward.under.underneath.until.up.upon.up to.with.within.without.with regard to.with respect to`.split(`.`);exports.PREPOSITIONS=e;
1
+
2
+ //#region ../string-format/src/prepositions.ts
3
+ const PREPOSITIONS = [
4
+ "about",
5
+ "above",
6
+ "across",
7
+ "after",
8
+ "against",
9
+ "along",
10
+ "among",
11
+ "around",
12
+ "at",
13
+ "because of",
14
+ "before",
15
+ "behind",
16
+ "below",
17
+ "beneath",
18
+ "beside",
19
+ "besides",
20
+ "between",
21
+ "beyond",
22
+ "but",
23
+ "by",
24
+ "concerning",
25
+ "despite",
26
+ "down",
27
+ "during",
28
+ "except",
29
+ "excepting",
30
+ "for",
31
+ "from",
32
+ "in",
33
+ "in front of",
34
+ "inside",
35
+ "in spite of",
36
+ "instead of",
37
+ "into",
38
+ "like",
39
+ "near",
40
+ "of",
41
+ "off",
42
+ "on",
43
+ "onto",
44
+ "out",
45
+ "outside",
46
+ "over",
47
+ "past",
48
+ "regarding",
49
+ "since",
50
+ "through",
51
+ "throughout",
52
+ "to",
53
+ "toward",
54
+ "under",
55
+ "underneath",
56
+ "until",
57
+ "up",
58
+ "upon",
59
+ "up to",
60
+ "with",
61
+ "within",
62
+ "without",
63
+ "with regard to",
64
+ "with respect to"
65
+ ];
66
+
67
+ //#endregion
68
+ exports.PREPOSITIONS = PREPOSITIONS;
@@ -1,2 +1,68 @@
1
- const e=`about.above.across.after.against.along.among.around.at.because of.before.behind.below.beneath.beside.besides.between.beyond.but.by.concerning.despite.down.during.except.excepting.for.from.in.in front of.inside.in spite of.instead of.into.like.near.of.off.on.onto.out.outside.over.past.regarding.since.through.throughout.to.toward.under.underneath.until.up.upon.up to.with.within.without.with regard to.with respect to`.split(`.`);export{e as PREPOSITIONS};
1
+ //#region ../string-format/src/prepositions.ts
2
+ const PREPOSITIONS = [
3
+ "about",
4
+ "above",
5
+ "across",
6
+ "after",
7
+ "against",
8
+ "along",
9
+ "among",
10
+ "around",
11
+ "at",
12
+ "because of",
13
+ "before",
14
+ "behind",
15
+ "below",
16
+ "beneath",
17
+ "beside",
18
+ "besides",
19
+ "between",
20
+ "beyond",
21
+ "but",
22
+ "by",
23
+ "concerning",
24
+ "despite",
25
+ "down",
26
+ "during",
27
+ "except",
28
+ "excepting",
29
+ "for",
30
+ "from",
31
+ "in",
32
+ "in front of",
33
+ "inside",
34
+ "in spite of",
35
+ "instead of",
36
+ "into",
37
+ "like",
38
+ "near",
39
+ "of",
40
+ "off",
41
+ "on",
42
+ "onto",
43
+ "out",
44
+ "outside",
45
+ "over",
46
+ "past",
47
+ "regarding",
48
+ "since",
49
+ "through",
50
+ "throughout",
51
+ "to",
52
+ "toward",
53
+ "under",
54
+ "underneath",
55
+ "until",
56
+ "up",
57
+ "upon",
58
+ "up to",
59
+ "with",
60
+ "within",
61
+ "without",
62
+ "with regard to",
63
+ "with respect to"
64
+ ];
65
+
66
+ //#endregion
67
+ export { PREPOSITIONS };
2
68
  //# sourceMappingURL=prepositions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepositions.mjs","names":[],"sources":["../../../../string-format/src/prepositions.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 PREPOSITIONS = [\n \"about\",\n \"above\",\n \"across\",\n \"after\",\n \"against\",\n \"along\",\n \"among\",\n \"around\",\n \"at\",\n \"because of\",\n \"before\",\n \"behind\",\n \"below\",\n \"beneath\",\n \"beside\",\n \"besides\",\n \"between\",\n \"beyond\",\n \"but\",\n \"by\",\n \"concerning\",\n \"despite\",\n \"down\",\n \"during\",\n \"except\",\n \"excepting\",\n \"for\",\n \"from\",\n \"in\",\n \"in front of\",\n \"inside\",\n \"in spite of\",\n \"instead of\",\n \"into\",\n \"like\",\n \"near\",\n \"of\",\n \"off\",\n \"on\",\n \"onto\",\n \"out\",\n \"outside\",\n \"over\",\n \"past\",\n \"regarding\",\n \"since\",\n \"through\",\n \"throughout\",\n \"to\",\n \"toward\",\n \"under\",\n \"underneath\",\n \"until\",\n \"up\",\n \"upon\",\n \"up to\",\n \"with\",\n \"within\",\n \"without\",\n \"with regard to\",\n \"with respect to\"\n];\n"],"mappings":"AAkBA,MAAa,EAAe,8aA8D3B"}
1
+ {"version":3,"file":"prepositions.mjs","names":[],"sources":["../../../../string-format/src/prepositions.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 PREPOSITIONS = [\n \"about\",\n \"above\",\n \"across\",\n \"after\",\n \"against\",\n \"along\",\n \"among\",\n \"around\",\n \"at\",\n \"because of\",\n \"before\",\n \"behind\",\n \"below\",\n \"beneath\",\n \"beside\",\n \"besides\",\n \"between\",\n \"beyond\",\n \"but\",\n \"by\",\n \"concerning\",\n \"despite\",\n \"down\",\n \"during\",\n \"except\",\n \"excepting\",\n \"for\",\n \"from\",\n \"in\",\n \"in front of\",\n \"inside\",\n \"in spite of\",\n \"instead of\",\n \"into\",\n \"like\",\n \"near\",\n \"of\",\n \"off\",\n \"on\",\n \"onto\",\n \"out\",\n \"outside\",\n \"over\",\n \"past\",\n \"regarding\",\n \"since\",\n \"through\",\n \"throughout\",\n \"to\",\n \"toward\",\n \"under\",\n \"underneath\",\n \"until\",\n \"up\",\n \"upon\",\n \"up to\",\n \"with\",\n \"within\",\n \"without\",\n \"with regard to\",\n \"with respect to\"\n];\n"],"mappings":";AAkBA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1 +1,53 @@
1
- const e=`2FA.4K.5K.8K.AGI.BI.ChatGPT.CTA.DateTime.FMS.GitHub.GPT.HD.IBMid.IDs.iMac.IMAX.iOS.iPad.iPhone.iPod.LDAP.LinkedIn.LLM.macOS.McDonalds.MCP.ML.MySQL.NLG.NLP.NLU.OpenAI.PDFs.PIM.PEFT.pH.PostgreSQL.SEO.TTS.UHD.UUID.XSS.YouTube.CSpell.ESLint`.split(`.`);exports.SPECIAL_CASES=e;
1
+
2
+ //#region ../string-format/src/special-cases.ts
3
+ const SPECIAL_CASES = [
4
+ "2FA",
5
+ "4K",
6
+ "5K",
7
+ "8K",
8
+ "AGI",
9
+ "BI",
10
+ "ChatGPT",
11
+ "CTA",
12
+ "DateTime",
13
+ "FMS",
14
+ "GitHub",
15
+ "GPT",
16
+ "HD",
17
+ "IBMid",
18
+ "IDs",
19
+ "iMac",
20
+ "IMAX",
21
+ "iOS",
22
+ "iPad",
23
+ "iPhone",
24
+ "iPod",
25
+ "LDAP",
26
+ "LinkedIn",
27
+ "LLM",
28
+ "macOS",
29
+ "McDonalds",
30
+ "MCP",
31
+ "ML",
32
+ "MySQL",
33
+ "NLG",
34
+ "NLP",
35
+ "NLU",
36
+ "OpenAI",
37
+ "PDFs",
38
+ "PIM",
39
+ "PEFT",
40
+ "pH",
41
+ "PostgreSQL",
42
+ "SEO",
43
+ "TTS",
44
+ "UHD",
45
+ "UUID",
46
+ "XSS",
47
+ "YouTube",
48
+ "CSpell",
49
+ "ESLint"
50
+ ];
51
+
52
+ //#endregion
53
+ exports.SPECIAL_CASES = SPECIAL_CASES;
@@ -1,2 +1,53 @@
1
- const e=`2FA.4K.5K.8K.AGI.BI.ChatGPT.CTA.DateTime.FMS.GitHub.GPT.HD.IBMid.IDs.iMac.IMAX.iOS.iPad.iPhone.iPod.LDAP.LinkedIn.LLM.macOS.McDonalds.MCP.ML.MySQL.NLG.NLP.NLU.OpenAI.PDFs.PIM.PEFT.pH.PostgreSQL.SEO.TTS.UHD.UUID.XSS.YouTube.CSpell.ESLint`.split(`.`);export{e as SPECIAL_CASES};
1
+ //#region ../string-format/src/special-cases.ts
2
+ const SPECIAL_CASES = [
3
+ "2FA",
4
+ "4K",
5
+ "5K",
6
+ "8K",
7
+ "AGI",
8
+ "BI",
9
+ "ChatGPT",
10
+ "CTA",
11
+ "DateTime",
12
+ "FMS",
13
+ "GitHub",
14
+ "GPT",
15
+ "HD",
16
+ "IBMid",
17
+ "IDs",
18
+ "iMac",
19
+ "IMAX",
20
+ "iOS",
21
+ "iPad",
22
+ "iPhone",
23
+ "iPod",
24
+ "LDAP",
25
+ "LinkedIn",
26
+ "LLM",
27
+ "macOS",
28
+ "McDonalds",
29
+ "MCP",
30
+ "ML",
31
+ "MySQL",
32
+ "NLG",
33
+ "NLP",
34
+ "NLU",
35
+ "OpenAI",
36
+ "PDFs",
37
+ "PIM",
38
+ "PEFT",
39
+ "pH",
40
+ "PostgreSQL",
41
+ "SEO",
42
+ "TTS",
43
+ "UHD",
44
+ "UUID",
45
+ "XSS",
46
+ "YouTube",
47
+ "CSpell",
48
+ "ESLint"
49
+ ];
50
+
51
+ //#endregion
52
+ export { SPECIAL_CASES };
2
53
  //# sourceMappingURL=special-cases.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"special-cases.mjs","names":[],"sources":["../../../../string-format/src/special-cases.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 SPECIAL_CASES = [\n \"2FA\",\n \"4K\",\n \"5K\",\n \"8K\",\n \"AGI\",\n \"BI\",\n \"ChatGPT\",\n \"CTA\",\n \"DateTime\",\n \"FMS\",\n \"GitHub\",\n \"GPT\",\n \"HD\",\n \"IBMid\",\n \"IDs\",\n \"iMac\",\n \"IMAX\",\n \"iOS\",\n \"iPad\",\n \"iPhone\",\n \"iPod\",\n \"LDAP\",\n \"LinkedIn\",\n \"LLM\",\n \"macOS\",\n \"McDonalds\",\n \"MCP\",\n \"ML\",\n \"MySQL\",\n \"NLG\",\n \"NLP\",\n \"NLU\",\n \"OpenAI\",\n \"PDFs\",\n \"PIM\",\n \"PEFT\",\n \"pH\",\n \"PostgreSQL\",\n \"SEO\",\n \"TTS\",\n \"UHD\",\n \"UUID\",\n \"XSS\",\n \"YouTube\",\n \"CSpell\",\n \"ESLint\"\n];\n"],"mappings":"AAkBA,MAAa,EAAgB,yPA+C5B"}
1
+ {"version":3,"file":"special-cases.mjs","names":[],"sources":["../../../../string-format/src/special-cases.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 SPECIAL_CASES = [\n \"2FA\",\n \"4K\",\n \"5K\",\n \"8K\",\n \"AGI\",\n \"BI\",\n \"ChatGPT\",\n \"CTA\",\n \"DateTime\",\n \"FMS\",\n \"GitHub\",\n \"GPT\",\n \"HD\",\n \"IBMid\",\n \"IDs\",\n \"iMac\",\n \"IMAX\",\n \"iOS\",\n \"iPad\",\n \"iPhone\",\n \"iPod\",\n \"LDAP\",\n \"LinkedIn\",\n \"LLM\",\n \"macOS\",\n \"McDonalds\",\n \"MCP\",\n \"ML\",\n \"MySQL\",\n \"NLG\",\n \"NLP\",\n \"NLU\",\n \"OpenAI\",\n \"PDFs\",\n \"PIM\",\n \"PEFT\",\n \"pH\",\n \"PostgreSQL\",\n \"SEO\",\n \"TTS\",\n \"UHD\",\n \"UUID\",\n \"XSS\",\n \"YouTube\",\n \"CSpell\",\n \"ESLint\"\n];\n"],"mappings":";AAkBA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -1 +1,19 @@
1
- const e=require(`./combine.cjs`),t=require(`./decamelize.cjs`),n=require(`./format-special-cases.cjs`),r=require(`./upper-case-first.cjs`);function i(i,a){return i?.split(/\s+-\s+/).map(i=>t.decamelize(i).split(/[\s\-_]/).map(r.upperCaseFirst).map((e,t,r)=>n.formatSpecialCases(e,t,r,a)).reduce(e.combine)).join(` - `)}exports.titleCase=i;
1
+ const require_combine = require('./combine.cjs');
2
+ const require_decamelize = require('./decamelize.cjs');
3
+ const require_format_special_cases = require('./format-special-cases.cjs');
4
+ const require_upper_case_first = require('./upper-case-first.cjs');
5
+
6
+ //#region ../string-format/src/title-case.ts
7
+ /**
8
+ * Convert a string to title case.
9
+ *
10
+ * @param input - The input string to convert.
11
+ * @param options - Options for formatting special cases.
12
+ * @returns The title cased string.
13
+ */
14
+ 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
+ }
17
+
18
+ //#endregion
19
+ exports.titleCase = titleCase;
@@ -1,2 +1,20 @@
1
- import{combine as e}from"./combine.mjs";import{decamelize as t}from"./decamelize.mjs";import{formatSpecialCases as n}from"./format-special-cases.mjs";import{upperCaseFirst as r}from"./upper-case-first.mjs";function i(i,a){return i?.split(/\s+-\s+/).map(i=>t(i).split(/[\s\-_]/).map(r).map((e,t,r)=>n(e,t,r,a)).reduce(e)).join(` - `)}export{i as titleCase};
1
+ import { combine } from "./combine.mjs";
2
+ import { decamelize } from "./decamelize.mjs";
3
+ import { formatSpecialCases } from "./format-special-cases.mjs";
4
+ import { upperCaseFirst } from "./upper-case-first.mjs";
5
+
6
+ //#region ../string-format/src/title-case.ts
7
+ /**
8
+ * Convert a string to title case.
9
+ *
10
+ * @param input - The input string to convert.
11
+ * @param options - Options for formatting special cases.
12
+ * @returns The title cased string.
13
+ */
14
+ 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
+ }
17
+
18
+ //#endregion
19
+ export { titleCase };
2
20
  //# sourceMappingURL=title-case.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"title-case.mjs","names":[],"sources":["../../../../string-format/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":"8MA+BA,SAAgB,EACd,EACA,EACG,CACH,OAAO,GACH,MAAM,UAAU,CACjB,IAAI,GACH,EAAW,EAAQ,CAChB,MAAM,UAAU,CAChB,IAAI,EAAe,CACnB,KAAK,EAAe,EAAe,IAClC,EAAmB,EAAO,EAAO,EAAO,EAAQ,CACjD,CACA,OAAO,EAAQ,CACnB,CACA,KAAK,MAAM"}
1
+ {"version":3,"file":"title-case.mjs","names":[],"sources":["../../../../string-format/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 +1,17 @@
1
- function e(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}exports.upperCaseFirst=e;
1
+
2
+ //#region ../string-format/src/upper-case-first.ts
3
+ /**
4
+ * Upper case the first character of an input string.
5
+ *
6
+ * @remarks
7
+ * "Thisisanexample"
8
+ *
9
+ * @param input - The input string.
10
+ * @returns The capitalized string.
11
+ */
12
+ function upperCaseFirst(input) {
13
+ return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
14
+ }
15
+
16
+ //#endregion
17
+ exports.upperCaseFirst = upperCaseFirst;
@@ -1,2 +1,17 @@
1
- function e(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}export{e as upperCaseFirst};
1
+ //#region ../string-format/src/upper-case-first.ts
2
+ /**
3
+ * Upper case the first character of an input string.
4
+ *
5
+ * @remarks
6
+ * "Thisisanexample"
7
+ *
8
+ * @param input - The input string.
9
+ * @returns The capitalized string.
10
+ */
11
+ function upperCaseFirst(input) {
12
+ return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
13
+ }
14
+
15
+ //#endregion
16
+ export { upperCaseFirst };
2
17
  //# sourceMappingURL=upper-case-first.mjs.map