toolbox-x 1.0.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.
- package/LICENSE +201 -0
- package/dist/Color-B3mgF9Dh.d.cts +486 -0
- package/dist/Color-D38Xrw65.d.mts +486 -0
- package/dist/Stylog-Df7eq3-j.d.cts +519 -0
- package/dist/Stylog-jvlLcMQq.d.mts +519 -0
- package/dist/array-DvW0zIu6.d.mts +130 -0
- package/dist/array-rUnEVisO.d.cts +130 -0
- package/dist/basics-D_eSv0cu.cjs +132 -0
- package/dist/basics-Dp_aEK81.mjs +115 -0
- package/dist/basics-WEYWlnRO.d.cts +95 -0
- package/dist/basics-uBSfkBEI.d.mts +95 -0
- package/dist/case-BWIt8Ash.mjs +449 -0
- package/dist/case-C-S-b5YP.d.cts +327 -0
- package/dist/case-CS8Ii3A7.cjs +526 -0
- package/dist/case-CybASFPD.d.mts +327 -0
- package/dist/change-case.cjs +32 -0
- package/dist/change-case.d.cts +18 -0
- package/dist/change-case.d.mts +18 -0
- package/dist/change-case.mjs +19 -0
- package/dist/colors.cjs +574 -0
- package/dist/colors.d.cts +355 -0
- package/dist/colors.d.mts +355 -0
- package/dist/colors.mjs +547 -0
- package/dist/constants-2gAw23_7.mjs +144 -0
- package/dist/constants-B34K0QPi.d.cts +21 -0
- package/dist/constants-BIBDKY1u.cjs +924 -0
- package/dist/constants-BWT-810U.cjs +158 -0
- package/dist/constants-BwbHnXlM.mjs +662 -0
- package/dist/constants-BxN9l5el.cjs +74 -0
- package/dist/constants-CLS_bgKD.d.mts +847 -0
- package/dist/constants-D73iFu8g.mjs +171 -0
- package/dist/constants-DAfRxaa8.mjs +62 -0
- package/dist/constants-DQYeCjlx.cjs +207 -0
- package/dist/constants-Deeie-iH.d.mts +21 -0
- package/dist/constants-DpTG9RP6.d.mts +29 -0
- package/dist/constants-DqwnkJ_d.cjs +740 -0
- package/dist/constants-DvRUY_FY.cjs +150 -0
- package/dist/constants-VcRtQu0K.d.cts +29 -0
- package/dist/constants-X5hm1UtB.mjs +912 -0
- package/dist/constants-eNd-iYsV.mjs +134 -0
- package/dist/constants-qm8FafmD.d.cts +847 -0
- package/dist/constants.cjs +415 -0
- package/dist/constants.d.cts +184 -0
- package/dist/constants.d.mts +184 -0
- package/dist/constants.mjs +378 -0
- package/dist/convert-BOCgUv2D.cjs +252 -0
- package/dist/convert-Bn4jFomQ.mjs +169 -0
- package/dist/convert-BrzlG-m_.cjs +475 -0
- package/dist/convert-DhaUoPVU.mjs +368 -0
- package/dist/converter-1P90_RcP.d.mts +402 -0
- package/dist/converter-CmkcAppi.d.cts +402 -0
- package/dist/converter.cjs +780 -0
- package/dist/converter.d.cts +29 -0
- package/dist/converter.d.mts +29 -0
- package/dist/converter.mjs +771 -0
- package/dist/countries-CIpmtEzV.cjs +1469 -0
- package/dist/countries-Cy0xiqS3.mjs +1463 -0
- package/dist/css-colors-Bx947Ng3.d.cts +179 -0
- package/dist/css-colors-CXCDqQbG.cjs +186 -0
- package/dist/css-colors-CXTp1vvy.d.mts +179 -0
- package/dist/css-colors-DfUW3nTR.mjs +180 -0
- package/dist/date.cjs +332 -0
- package/dist/date.d.cts +213 -0
- package/dist/date.d.mts +213 -0
- package/dist/date.mjs +298 -0
- package/dist/dom.cjs +461 -0
- package/dist/dom.d.cts +228 -0
- package/dist/dom.d.mts +228 -0
- package/dist/dom.mjs +429 -0
- package/dist/form-BMFVGUrN.d.mts +118 -0
- package/dist/form-DRFbryvK.d.cts +118 -0
- package/dist/guards-3kaUX66g.mjs +157 -0
- package/dist/guards-C8gkvIHb.cjs +240 -0
- package/dist/guards-DdyU4h4o.mjs +110 -0
- package/dist/guards-Efhp1mNy.cjs +151 -0
- package/dist/guards.cjs +172 -0
- package/dist/guards.d.cts +399 -0
- package/dist/guards.d.mts +399 -0
- package/dist/guards.mjs +75 -0
- package/dist/hash-B6JPEyAz.d.mts +131 -0
- package/dist/hash-NTpeKYB_.d.cts +131 -0
- package/dist/hash.cjs +2126 -0
- package/dist/hash.d.cts +1239 -0
- package/dist/hash.d.mts +1239 -0
- package/dist/hash.mjs +2095 -0
- package/dist/http-status-BAZdtr7-.d.mts +65 -0
- package/dist/http-status-U_3MtoGb.d.cts +65 -0
- package/dist/http-status.cjs +173 -0
- package/dist/http-status.d.cts +142 -0
- package/dist/http-status.d.mts +142 -0
- package/dist/http-status.mjs +171 -0
- package/dist/index.cjs +2551 -0
- package/dist/index.d.cts +1493 -0
- package/dist/index.d.mts +1493 -0
- package/dist/index.mjs +2357 -0
- package/dist/object-B0TV3eHx.d.mts +8052 -0
- package/dist/object-Blq0Amdv.d.cts +8052 -0
- package/dist/objectify-CDs0Fbr1.mjs +417 -0
- package/dist/objectify-DIJ-OBmo.cjs +524 -0
- package/dist/paginator.cjs +245 -0
- package/dist/paginator.d.cts +144 -0
- package/dist/paginator.d.mts +144 -0
- package/dist/paginator.mjs +243 -0
- package/dist/parse-2ubxXZRp.cjs +211 -0
- package/dist/parse-N7g942uy.mjs +164 -0
- package/dist/pluralizer-BjMIc6uT.d.mts +42 -0
- package/dist/pluralizer-Cb6ZmrDl.d.cts +42 -0
- package/dist/pluralizer.cjs +678 -0
- package/dist/pluralizer.d.cts +152 -0
- package/dist/pluralizer.d.mts +152 -0
- package/dist/pluralizer.mjs +676 -0
- package/dist/primitives-B26uZolQ.cjs +228 -0
- package/dist/primitives-KsFUp3kQ.mjs +144 -0
- package/dist/specials-D48_IZbd.d.mts +108 -0
- package/dist/specials-DzLr1ZgU.cjs +477 -0
- package/dist/specials-LVONlKbQ.d.cts +108 -0
- package/dist/specials-uhDuRg8H.mjs +292 -0
- package/dist/string-CBAbxaG1.d.mts +258 -0
- package/dist/string-CsNsm_65.d.cts +258 -0
- package/dist/stylog.cjs +621 -0
- package/dist/stylog.d.cts +49 -0
- package/dist/stylog.d.mts +49 -0
- package/dist/stylog.mjs +614 -0
- package/dist/timezone-B2OYK6Fh.mjs +5589 -0
- package/dist/timezone-Beh9IGpw.cjs +5625 -0
- package/dist/types/array.cjs +16 -0
- package/dist/types/array.d.cts +18 -0
- package/dist/types/array.d.mts +18 -0
- package/dist/types/array.mjs +17 -0
- package/dist/types/colors.cjs +16 -0
- package/dist/types/colors.d.cts +18 -0
- package/dist/types/colors.d.mts +18 -0
- package/dist/types/colors.mjs +17 -0
- package/dist/types/converter.cjs +16 -0
- package/dist/types/converter.d.cts +18 -0
- package/dist/types/converter.d.mts +18 -0
- package/dist/types/converter.mjs +17 -0
- package/dist/types/form.cjs +16 -0
- package/dist/types/form.d.cts +18 -0
- package/dist/types/form.d.mts +18 -0
- package/dist/types/form.mjs +17 -0
- package/dist/types/hash.cjs +16 -0
- package/dist/types/hash.d.cts +18 -0
- package/dist/types/hash.d.mts +18 -0
- package/dist/types/hash.mjs +17 -0
- package/dist/types/http-status.cjs +16 -0
- package/dist/types/http-status.d.cts +18 -0
- package/dist/types/http-status.d.mts +18 -0
- package/dist/types/http-status.mjs +17 -0
- package/dist/types/index.cjs +16 -0
- package/dist/types/index.d.cts +18 -0
- package/dist/types/index.d.mts +18 -0
- package/dist/types/index.mjs +17 -0
- package/dist/types/number.cjs +16 -0
- package/dist/types/number.d.cts +18 -0
- package/dist/types/number.d.mts +18 -0
- package/dist/types/number.mjs +17 -0
- package/dist/types/object.cjs +16 -0
- package/dist/types/object.d.cts +18 -0
- package/dist/types/object.d.mts +18 -0
- package/dist/types/object.mjs +17 -0
- package/dist/types/pluralizer.cjs +16 -0
- package/dist/types/pluralizer.d.cts +18 -0
- package/dist/types/pluralizer.d.mts +18 -0
- package/dist/types/pluralizer.mjs +17 -0
- package/dist/types/string.cjs +16 -0
- package/dist/types/string.d.cts +18 -0
- package/dist/types/string.d.mts +18 -0
- package/dist/types/string.mjs +17 -0
- package/dist/types/stylog.cjs +16 -0
- package/dist/types/stylog.d.cts +18 -0
- package/dist/types/stylog.d.mts +18 -0
- package/dist/types/stylog.mjs +17 -0
- package/dist/types/utils.cjs +16 -0
- package/dist/types/utils.d.cts +18 -0
- package/dist/types/utils.d.mts +18 -0
- package/dist/types/utils.mjs +17 -0
- package/dist/types/verbalizer.cjs +16 -0
- package/dist/types/verbalizer.d.cts +30 -0
- package/dist/types/verbalizer.d.mts +30 -0
- package/dist/types/verbalizer.mjs +17 -0
- package/dist/utilities-CLUmdQeV.cjs +140 -0
- package/dist/utilities-m5yFKqLd.mjs +105 -0
- package/dist/utils-ClW9LA6f.mjs +449 -0
- package/dist/utils-DLFRgXUC.cjs +568 -0
- package/dist/verbalizer.cjs +998 -0
- package/dist/verbalizer.d.cts +148 -0
- package/dist/verbalizer.d.mts +148 -0
- package/dist/verbalizer.mjs +996 -0
- package/package.json +249 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { B as TitleCase, I as SentenceCase, L as SnakeCase, M as PascalSnakeCase, N as PathCase, T as DotCase, V as TrainCase, f as CamelCase, g as ConstantCase, j as PascalCase, k as KebabCase, m as CaseFormat, p as CapitalizeOptions, z as StringCaseOptions } from "./string-CBAbxaG1.mjs";
|
|
18
|
+
|
|
19
|
+
//#region src/string/case.d.ts
|
|
20
|
+
/**
|
|
21
|
+
* * Converts a string to a specified case format with advanced handling for word boundaries, punctuation, acronyms, and Unicode characters.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* - This function is Unicode-aware, treats non-alphanumeric characters (spaces, underscores, dots, slashes, etc.) as word boundaries, and optionally preserves internal acronyms.
|
|
25
|
+
* - `Title Case` formatting respects small words such as prepositions, articles, conjunctions, and auxiliary verbs (defined in `LOWERCASE`) — these are not capitalized unless they appear at the start or end of the string.
|
|
26
|
+
* - Leading and trailing punctuation (non-letter/number characters) is preserved in the result.
|
|
27
|
+
*
|
|
28
|
+
* @param value - The input string to convert. Can contain letters, numbers, punctuation,
|
|
29
|
+
* spaces, underscores, dashes, etc.
|
|
30
|
+
* @param format - The target case format:
|
|
31
|
+
* - `'camelCase'` → camelCase (e.g., `myVariableName`)
|
|
32
|
+
* - `'PascalCase'` → PascalCase (e.g., `MyVariableName`)
|
|
33
|
+
* - `'snake_case'` → snake_case (e.g., `my_variable_name`)
|
|
34
|
+
* - `'kebab-case'` → kebab-case (e.g., `my-variable-name`)
|
|
35
|
+
* - `'Title Case'` → Title Case (e.g., `My Variable Name`)
|
|
36
|
+
* - `'Sentence case'` → Sentence case (e.g., `My variable name`)
|
|
37
|
+
* - `'lowercase'` → all lowercase [ It is recommended to use built-in string method `string.toLowerCase()` ]
|
|
38
|
+
* - `'UPPERCASE'` → all uppercase [ It is recommended to use built-in string method `string.toUpperCase()` ]
|
|
39
|
+
* @param options - Optional configuration options for more control.
|
|
40
|
+
*
|
|
41
|
+
* @returns The converted string, with leading/trailing punctuation preserved.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Basic usage
|
|
45
|
+
* convertStringCase('my-example_string', 'camelCase');
|
|
46
|
+
* // Returns: 'myExampleString'
|
|
47
|
+
*
|
|
48
|
+
* convertStringCase('my-example_string', 'snake_case');
|
|
49
|
+
* // Returns: 'my_example_string'
|
|
50
|
+
*
|
|
51
|
+
* convertStringCase('my-example_string', 'kebab-case');
|
|
52
|
+
* // Returns: 'my-example-string'
|
|
53
|
+
*
|
|
54
|
+
* convertStringCase('my example string', 'Title Case');
|
|
55
|
+
* // Returns: 'My Example String'
|
|
56
|
+
*
|
|
57
|
+
* convertStringCase('my example string', 'Sentence case');
|
|
58
|
+
* // Returns: 'My example string'
|
|
59
|
+
*
|
|
60
|
+
* convertStringCase('My example String', 'lowercase');
|
|
61
|
+
* // Returns: 'my example string'
|
|
62
|
+
*
|
|
63
|
+
* convertStringCase('my example string', 'UPPERCASE');
|
|
64
|
+
* // Returns: 'MY EXAMPLE STRING'
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Preserve acronyms
|
|
68
|
+
* convertStringCase('get API response', 'camelCase', { preserveAcronyms: true });
|
|
69
|
+
* // Returns: 'getAPIResponse'
|
|
70
|
+
*
|
|
71
|
+
* convertStringCase('get API response', 'PascalCase', { preserveAcronyms: true });
|
|
72
|
+
* // Returns: 'GetAPIResponse'
|
|
73
|
+
*
|
|
74
|
+
* convertStringCase('the API of things', 'Title Case', { preserveAcronyms: true });
|
|
75
|
+
* // Returns: 'The API of Things'
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Leading/trailing punctuation is preserved
|
|
79
|
+
* convertStringCase('++hello_world++', 'PascalCase');
|
|
80
|
+
* // Returns: '++HelloWorld++'
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // Dashes are preserved in Title Case
|
|
84
|
+
* convertStringCase('xml-http_request', 'Title Case');
|
|
85
|
+
* // Returns: 'Xml-http Request'
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // Empty string returns empty
|
|
89
|
+
* convertStringCase('', 'camelCase');
|
|
90
|
+
* // Returns: ''
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // Single token is capitalized properly
|
|
94
|
+
* convertStringCase('api', 'PascalCase');
|
|
95
|
+
* // Returns: 'Api'
|
|
96
|
+
*/
|
|
97
|
+
declare function convertStringCase(value: string, format: CaseFormat, options?: StringCaseOptions): string;
|
|
98
|
+
/**
|
|
99
|
+
* * Utility to convert the first letter of any string to uppercase and the rest lowercase (unless specified).
|
|
100
|
+
* * Handles surrounding symbols like quotes or parentheses.
|
|
101
|
+
*
|
|
102
|
+
* @param string String to be capitalized.
|
|
103
|
+
* @param options Options to customize the capitalization.
|
|
104
|
+
* @returns Capitalized string or fully uppercased string depending on `capitalizeAll` option.
|
|
105
|
+
*/
|
|
106
|
+
declare function capitalizeString(string: string, options?: CapitalizeOptions): string;
|
|
107
|
+
/**
|
|
108
|
+
* * Converts a string into `camelCase`, using the optional custom delimiters in addition to the default delimiters.
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
112
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
113
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
114
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
115
|
+
* - It does not handle ACRONYMS properly, so be cautious when the string has ACRONYMS or use {@link convertStringCase}.
|
|
116
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* toCamelCase("hello world") // "helloWorld"
|
|
120
|
+
* toCamelCase("my-awesome_string") // "myAwesomeString"
|
|
121
|
+
* toCamelCase("value*with+custom", "*+") // "valueWithCustom"
|
|
122
|
+
*
|
|
123
|
+
* @param str The input string to convert.
|
|
124
|
+
* @param del Additional delimiter characters to recognize.
|
|
125
|
+
* @returns The `camelCase` formatted string.
|
|
126
|
+
*/
|
|
127
|
+
declare function toCamelCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): CamelCase<Str, Del>;
|
|
128
|
+
/**
|
|
129
|
+
* * Converts a string into `PascalCase`, using the optional custom delimiters in addition to the default delimiters.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
133
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
134
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
135
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
136
|
+
* - It does not handle ACRONYMS properly, so be cautious when the string has ACRONYMS or use {@link convertStringCase}.
|
|
137
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* toPascalCase("hello world") // "HelloWorld"
|
|
141
|
+
* toPascalCase("my-awesome_string") // "MyAwesomeString"
|
|
142
|
+
* toPascalCase("value*with+custom", "*+") // "ValueWithCustom"
|
|
143
|
+
*
|
|
144
|
+
* @param str The input string to convert.
|
|
145
|
+
* @param del Additional delimiter characters to recognize.
|
|
146
|
+
* @returns The `PascalCase` formatted string.
|
|
147
|
+
*/
|
|
148
|
+
declare function toPascalCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): PascalCase<Str, Del>;
|
|
149
|
+
/**
|
|
150
|
+
* * Converts a string into `snake_case`, using the optional custom delimiters in addition to the default delimiters.
|
|
151
|
+
*
|
|
152
|
+
* @remarks
|
|
153
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
154
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
155
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
156
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
157
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* toSnakeCase("hello world") // "hello_world"
|
|
161
|
+
* toSnakeCase("my-awesome_string") // "my_awesome_string"
|
|
162
|
+
* toSnakeCase("value*with+custom", "*+") // "value_with_custom"
|
|
163
|
+
*
|
|
164
|
+
* @param str The input string to convert.
|
|
165
|
+
* @param del Additional delimiter characters to recognize.
|
|
166
|
+
* @returns The `snake_case` formatted string.
|
|
167
|
+
*/
|
|
168
|
+
declare function toSnakeCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): SnakeCase<Str, Del>;
|
|
169
|
+
/**
|
|
170
|
+
* * Converts a string into `kebab-case`, using the optional custom delimiters in addition to the default delimiters.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
174
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
175
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
176
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
177
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* toKebabCase("hello world") // "hello-world"
|
|
181
|
+
* toKebabCase("my-awesome_string") // "my-awesome-string"
|
|
182
|
+
* toKebabCase("value*with+custom", "*+") // "value-with-custom"
|
|
183
|
+
*
|
|
184
|
+
* @param str The input string to convert.
|
|
185
|
+
* @param del Additional delimiter characters to recognize.
|
|
186
|
+
* @returns The `kebab-case` formatted string.
|
|
187
|
+
*/
|
|
188
|
+
declare function toKebabCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): KebabCase<Str, Del>;
|
|
189
|
+
/**
|
|
190
|
+
* * Converts a string into `Train-Case`, using the optional custom delimiters in addition to the default delimiters.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
194
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
195
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
196
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* toTrainCase("hello world") // "Hello-World"
|
|
200
|
+
* toTrainCase("my-awesome_string") // "My-Awesome-String"
|
|
201
|
+
* toTrainCase("value*with+custom", "*+") // "Value-With-Custom"
|
|
202
|
+
*
|
|
203
|
+
* @param str The input string to convert.
|
|
204
|
+
* @param del Additional delimiter characters to recognize.
|
|
205
|
+
* @returns The `Train-Case` formatted string.
|
|
206
|
+
*/
|
|
207
|
+
declare function toTrainCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): TrainCase<Str, Del>;
|
|
208
|
+
/**
|
|
209
|
+
* * Converts a string into `dot.case`, using the optional custom delimiters in addition to the default delimiters.
|
|
210
|
+
*
|
|
211
|
+
* @remarks
|
|
212
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
213
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
214
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
215
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* toDotCase("hello world") // "hello.world"
|
|
219
|
+
* toDotCase("my-awesome_string") // "my.awesome.string"
|
|
220
|
+
* toDotCase("value*with+custom", "*+") // "value.with.custom"
|
|
221
|
+
*
|
|
222
|
+
* @param str The input string to convert.
|
|
223
|
+
* @param del Additional delimiter characters to recognize.
|
|
224
|
+
* @returns The `dot.case` formatted string.
|
|
225
|
+
*/
|
|
226
|
+
declare function toDotCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): DotCase<Str, Del>;
|
|
227
|
+
/**
|
|
228
|
+
* * Converts a string into `path/case`, using the optional custom delimiters in addition to the default delimiters.
|
|
229
|
+
*
|
|
230
|
+
* @remarks
|
|
231
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
232
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
233
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
234
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* toPathCase("hello world") // "hello/world"
|
|
238
|
+
* toPathCase("my-awesome_string") // "my/awesome/string"
|
|
239
|
+
* toPathCase("value*with+custom", "*+") // "value/with/custom"
|
|
240
|
+
*
|
|
241
|
+
* @param str The input string to convert.
|
|
242
|
+
* @param del Additional delimiter characters to recognize.
|
|
243
|
+
* @returns The `path/case` formatted string.
|
|
244
|
+
*/
|
|
245
|
+
declare function toPathCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): PathCase<Str, Del>;
|
|
246
|
+
/**
|
|
247
|
+
* * Converts a string into `CONSTANT_CASE`, using the optional custom delimiters in addition to the default delimiters.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
251
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
252
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
253
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* toConstantCase("hello world") // "HELLO_WORLD"
|
|
257
|
+
* toConstantCase("my-awesome_string") // "MY_AWESOME_STRING"
|
|
258
|
+
* toConstantCase("value*with+custom", "*+") // "VALUE_WITH_CUSTOM"
|
|
259
|
+
*
|
|
260
|
+
* @param str The input string to convert.
|
|
261
|
+
* @param del Additional delimiter characters to recognize.
|
|
262
|
+
* @returns The `CONSTANT_CASE` formatted string.
|
|
263
|
+
*/
|
|
264
|
+
declare function toConstantCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): ConstantCase<Str, Del>;
|
|
265
|
+
/**
|
|
266
|
+
* * Converts a string into `Pascal_Snake_Case`, using the optional custom delimiters in addition to the default delimiters.
|
|
267
|
+
*
|
|
268
|
+
* @remarks
|
|
269
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
270
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
271
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
272
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* toPascalSnakeCase("hello world") // "Hello_World"
|
|
276
|
+
* toPascalSnakeCase("my-awesome_string") // "My_Awesome_String"
|
|
277
|
+
* toPascalSnakeCase("value*with+custom", "*+") // "Value_With_Custom"
|
|
278
|
+
*
|
|
279
|
+
* @param str The input string to convert.
|
|
280
|
+
* @param del Additional delimiter characters to recognize.
|
|
281
|
+
* @returns The `Pascal_Snake_Case` formatted string.
|
|
282
|
+
*/
|
|
283
|
+
declare function toPascalSnakeCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): PascalSnakeCase<Str, Del>;
|
|
284
|
+
/**
|
|
285
|
+
* * Converts a string into `Title Case`, using the optional custom delimiters in addition to the default delimiters.
|
|
286
|
+
*
|
|
287
|
+
* @remarks
|
|
288
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
289
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
290
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
291
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
292
|
+
* - It does not handle ACRONYMS properly, so be cautious when the string has ACRONYMS or use {@link convertStringCase}.
|
|
293
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* toTitleCase("hello world") // "Hello World"
|
|
297
|
+
* toTitleCase("my-awesome_string") // "My Awesome String"
|
|
298
|
+
* toTitleCase("value*with+custom", "*+") // "Value with Custom"
|
|
299
|
+
*
|
|
300
|
+
* @param str The input string to convert.
|
|
301
|
+
* @param del Additional delimiter characters to recognize.
|
|
302
|
+
* @returns The `Title Case` formatted string.
|
|
303
|
+
*/
|
|
304
|
+
declare function toTitleCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): TitleCase<Str, Del>;
|
|
305
|
+
/**
|
|
306
|
+
* * Converts a string into `Sentence case`, using the optional custom delimiters in addition to the default delimiters.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* - This utility returns appropriate type IntelliSense with string literal. For general purpose use {@link convertStringCase}.
|
|
310
|
+
* - At the type level, TypeScript supports `up to 45 characters` for reliable literal inference.
|
|
311
|
+
* - This limitation does not affect runtime behavior but shows TypeScript compiler error.
|
|
312
|
+
* - Use it for short literal strings (`up to 45 characters`) for best performance.
|
|
313
|
+
* - It does not handle ACRONYMS properly, so be cautious when the string has ACRONYMS or use {@link convertStringCase}.
|
|
314
|
+
* - Custom delimiters are merged with the default set: `space`, `.`, `-`, `_`, `/`.
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* toSentenceCase("hello world") // "Hello world"
|
|
318
|
+
* toSentenceCase("my-awesome_string") // "My awesome string"
|
|
319
|
+
* toSentenceCase("value*with+custom", "*+") // "Value with custom"
|
|
320
|
+
*
|
|
321
|
+
* @param str The input string to convert.
|
|
322
|
+
* @param del Additional delimiter characters to recognize.
|
|
323
|
+
* @returns The `Sentence case` formatted string.
|
|
324
|
+
*/
|
|
325
|
+
declare function toSentenceCase<Str extends string, Del extends string = ''>(str: Str, ...del: Del[]): SentenceCase<Str, Del>;
|
|
326
|
+
//#endregion
|
|
327
|
+
export { toDotCase as a, toPascalSnakeCase as c, toSnakeCase as d, toTitleCase as f, toConstantCase as i, toPathCase as l, convertStringCase as n, toKebabCase as o, toTrainCase as p, toCamelCase as r, toPascalCase as s, capitalizeString as t, toSentenceCase as u };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
|
+
const require_case = require('./case-CS8Ii3A7.cjs');
|
|
19
|
+
|
|
20
|
+
exports.capitalizeString = require_case.capitalizeString;
|
|
21
|
+
exports.convertStringCase = require_case.convertStringCase;
|
|
22
|
+
exports.toCamelCase = require_case.toCamelCase;
|
|
23
|
+
exports.toConstantCase = require_case.toConstantCase;
|
|
24
|
+
exports.toDotCase = require_case.toDotCase;
|
|
25
|
+
exports.toKebabCase = require_case.toKebabCase;
|
|
26
|
+
exports.toPascalCase = require_case.toPascalCase;
|
|
27
|
+
exports.toPascalSnakeCase = require_case.toPascalSnakeCase;
|
|
28
|
+
exports.toPathCase = require_case.toPathCase;
|
|
29
|
+
exports.toSentenceCase = require_case.toSentenceCase;
|
|
30
|
+
exports.toSnakeCase = require_case.toSnakeCase;
|
|
31
|
+
exports.toTitleCase = require_case.toTitleCase;
|
|
32
|
+
exports.toTrainCase = require_case.toTrainCase;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-C-S-b5YP.cjs";
|
|
18
|
+
export { capitalizeString, convertStringCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPascalSnakeCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, toTrainCase };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-CybASFPD.mjs";
|
|
18
|
+
export { capitalizeString, convertStringCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPascalSnakeCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, toTrainCase };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { a as toDotCase, c as toPascalSnakeCase, d as toSnakeCase, f as toTitleCase, i as toConstantCase, l as toPathCase, n as convertStringCase, o as toKebabCase, p as toTrainCase, r as toCamelCase, s as toPascalCase, t as capitalizeString, u as toSentenceCase } from "./case-BWIt8Ash.mjs";
|
|
18
|
+
|
|
19
|
+
export { capitalizeString, convertStringCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPascalSnakeCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, toTrainCase };
|