@stryke/env 0.20.86 → 0.20.88

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 (84) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  3. package/dist/ci-checks.cjs +1 -0
  4. package/dist/ci-checks.d.cts.map +1 -1
  5. package/dist/ci-checks.d.mts.map +1 -1
  6. package/dist/environment-checks.cjs +11 -10
  7. package/dist/environment-checks.d.cts.map +1 -1
  8. package/dist/environment-checks.d.mts.map +1 -1
  9. package/dist/environment-checks.mjs +10 -10
  10. package/dist/environment-checks.mjs.map +1 -1
  11. package/dist/get-env-paths.cjs +31 -30
  12. package/dist/get-env-paths.d.cts.map +1 -1
  13. package/dist/get-env-paths.d.mts.map +1 -1
  14. package/dist/get-env-paths.mjs +2 -2
  15. package/dist/index.cjs +1 -0
  16. package/dist/load-env.cjs +16 -15
  17. package/dist/load-env.d.cts.map +1 -1
  18. package/dist/load-env.d.mts.map +1 -1
  19. package/dist/load-env.mjs +7 -7
  20. package/dist/load-env.mjs.map +1 -1
  21. package/dist/providers.cjs +5 -4
  22. package/dist/providers.d.cts.map +1 -1
  23. package/dist/providers.d.mts.map +1 -1
  24. package/dist/providers.mjs +4 -4
  25. package/dist/providers.mjs.map +1 -1
  26. package/dist/runtime-checks.cjs +1 -0
  27. package/dist/runtime-checks.d.cts.map +1 -1
  28. package/dist/runtime-checks.d.mts.map +1 -1
  29. package/dist/runtime-checks.mjs.map +1 -1
  30. package/dist/types.cjs +1 -0
  31. package/dist/types.d.cts.map +1 -1
  32. package/dist/types.d.mts.map +1 -1
  33. package/package.json +21 -21
  34. package/dist/convert/src/to-array.cjs +0 -15
  35. package/dist/convert/src/to-array.mjs +0 -15
  36. package/dist/convert/src/to-array.mjs.map +0 -1
  37. package/dist/fs/src/exists.cjs +0 -17
  38. package/dist/fs/src/exists.mjs +0 -16
  39. package/dist/fs/src/exists.mjs.map +0 -1
  40. package/dist/fs/src/read-file.cjs +0 -17
  41. package/dist/fs/src/read-file.mjs +0 -17
  42. package/dist/fs/src/read-file.mjs.map +0 -1
  43. package/dist/path/src/is-type.cjs +0 -28
  44. package/dist/path/src/is-type.mjs +0 -29
  45. package/dist/path/src/is-type.mjs.map +0 -1
  46. package/dist/path/src/join-paths.cjs +0 -122
  47. package/dist/path/src/join-paths.mjs +0 -123
  48. package/dist/path/src/join-paths.mjs.map +0 -1
  49. package/dist/path/src/regex.cjs +0 -12
  50. package/dist/path/src/regex.mjs +0 -9
  51. package/dist/path/src/regex.mjs.map +0 -1
  52. package/dist/path/src/slash.cjs +0 -15
  53. package/dist/path/src/slash.mjs +0 -15
  54. package/dist/path/src/slash.mjs.map +0 -1
  55. package/dist/string-format/src/acronyms.cjs +0 -415
  56. package/dist/string-format/src/acronyms.mjs +0 -415
  57. package/dist/string-format/src/acronyms.mjs.map +0 -1
  58. package/dist/string-format/src/articles.cjs +0 -10
  59. package/dist/string-format/src/articles.mjs +0 -10
  60. package/dist/string-format/src/articles.mjs.map +0 -1
  61. package/dist/string-format/src/combine.cjs +0 -15
  62. package/dist/string-format/src/combine.mjs +0 -15
  63. package/dist/string-format/src/combine.mjs.map +0 -1
  64. package/dist/string-format/src/conjunctions.cjs +0 -32
  65. package/dist/string-format/src/conjunctions.mjs +0 -32
  66. package/dist/string-format/src/conjunctions.mjs.map +0 -1
  67. package/dist/string-format/src/decamelize.cjs +0 -14
  68. package/dist/string-format/src/decamelize.mjs +0 -14
  69. package/dist/string-format/src/decamelize.mjs.map +0 -1
  70. package/dist/string-format/src/format-special-cases.cjs +0 -33
  71. package/dist/string-format/src/format-special-cases.mjs +0 -34
  72. package/dist/string-format/src/format-special-cases.mjs.map +0 -1
  73. package/dist/string-format/src/prepositions.cjs +0 -68
  74. package/dist/string-format/src/prepositions.mjs +0 -68
  75. package/dist/string-format/src/prepositions.mjs.map +0 -1
  76. package/dist/string-format/src/special-cases.cjs +0 -53
  77. package/dist/string-format/src/special-cases.mjs +0 -53
  78. package/dist/string-format/src/special-cases.mjs.map +0 -1
  79. package/dist/string-format/src/title-case.cjs +0 -20
  80. package/dist/string-format/src/title-case.mjs +0 -21
  81. package/dist/string-format/src/title-case.mjs.map +0 -1
  82. package/dist/string-format/src/upper-case-first.cjs +0 -17
  83. package/dist/string-format/src/upper-case-first.mjs +0 -17
  84. package/dist/string-format/src/upper-case-first.mjs.map +0 -1
@@ -1 +0,0 @@
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,33 +0,0 @@
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,34 +0,0 @@
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 };
34
- //# sourceMappingURL=format-special-cases.mjs.map
@@ -1 +0,0 @@
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,68 +0,0 @@
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,68 +0,0 @@
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 };
68
- //# sourceMappingURL=prepositions.mjs.map
@@ -1 +0,0 @@
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,53 +0,0 @@
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,53 +0,0 @@
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 };
53
- //# sourceMappingURL=special-cases.mjs.map
@@ -1 +0,0 @@
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,20 +0,0 @@
1
- const require_acronyms = require('./acronyms.cjs');
2
- const require_combine = require('./combine.cjs');
3
- const require_decamelize = require('./decamelize.cjs');
4
- const require_format_special_cases = require('./format-special-cases.cjs');
5
- const require_upper_case_first = require('./upper-case-first.cjs');
6
-
7
- //#region ../string-format/src/title-case.ts
8
- /**
9
- * Convert a string to title case.
10
- *
11
- * @param input - The input string to convert.
12
- * @param options - Options for formatting special cases.
13
- * @returns The title cased string.
14
- */
15
- function titleCase(input, options) {
16
- return input?.replaceAll(":", " - ")?.replaceAll("+", " + ")?.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(" - ");
17
- }
18
-
19
- //#endregion
20
- exports.titleCase = titleCase;
@@ -1,21 +0,0 @@
1
- import { ACRONYMS } from "./acronyms.mjs";
2
- import { combine } from "./combine.mjs";
3
- import { decamelize } from "./decamelize.mjs";
4
- import { formatSpecialCases } from "./format-special-cases.mjs";
5
- import { upperCaseFirst } from "./upper-case-first.mjs";
6
-
7
- //#region ../string-format/src/title-case.ts
8
- /**
9
- * Convert a string to title case.
10
- *
11
- * @param input - The input string to convert.
12
- * @param options - Options for formatting special cases.
13
- * @returns The title cased string.
14
- */
15
- function titleCase(input, options) {
16
- return input?.replaceAll(":", " - ")?.replaceAll("+", " + ")?.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(" - ");
17
- }
18
-
19
- //#endregion
20
- export { titleCase };
21
- //# sourceMappingURL=title-case.mjs.map
@@ -1 +0,0 @@
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 { 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 ?.replaceAll(\":\", \" - \")\n ?.replaceAll(\"+\", \" + \")\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,WAAW,KAAK,MAAM,EACtB,WAAW,KAAK,MAAM,EACtB,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"}
@@ -1,17 +0,0 @@
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,17 +0,0 @@
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 };
17
- //# sourceMappingURL=upper-case-first.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upper-case-first.mjs","names":[],"sources":["../../../../string-format/src/upper-case-first.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 * Upper case the first character of an input string.\n *\n * @remarks\n * \"Thisisanexample\"\n *\n * @param input - The input string.\n * @returns The capitalized string.\n */\nexport function upperCaseFirst<T extends string | undefined>(input?: T): T {\n return (input ? input.charAt(0).toUpperCase() + input.slice(1) : input) as T;\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,eAA6C,OAAc;AACzE,QAAQ,QAAQ,MAAM,OAAO,EAAE,CAAC,aAAa,GAAG,MAAM,MAAM,EAAE,GAAG"}