@rzl-zone/utils-js 3.2.6-beta.0 → 3.3.1
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/README.md +82 -51
- package/dist/NumberRangeUnion-B6bhM2s7.d.ts +33 -0
- package/dist/{any-BmdI8UbK.d.ts → any-v4TsK9ES.d.ts} +25 -26
- package/dist/{arrays-normalize-recursive-CnjYJ9xg.d.ts → arrays-normalize-recursive-BqmVuFlD.d.ts} +20 -20
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +96 -70
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-2CQX5CBG.js +1 -0
- package/dist/chunk-2IOOEY45.cjs +1 -0
- package/dist/chunk-3IBQ5MOM.js +1 -0
- package/dist/{chunk-OGPPP2S3.js → chunk-3VA554KW.js} +1 -1
- package/dist/{chunk-FV7SEBKD.cjs → chunk-5757UBXJ.cjs} +1 -1
- package/dist/{chunk-MTUBDVJ2.js → chunk-5IGC6PBH.js} +1 -1
- package/dist/{chunk-O7UT5AN3.cjs → chunk-5KJFVIQT.cjs} +1 -1
- package/dist/chunk-6JFCSH7J.js +1 -0
- package/dist/{chunk-VHAPTHEA.cjs → chunk-6JFZL7YE.cjs} +1 -1
- package/dist/chunk-7ODAAXX5.cjs +1 -0
- package/dist/{chunk-6C3ATUGM.cjs → chunk-CAH33WOQ.cjs} +1 -1
- package/dist/{chunk-ECRNH4FW.js → chunk-CKTLUNWX.js} +1 -1
- package/dist/chunk-CMW2TBOQ.js +1 -0
- package/dist/chunk-D3ENH7H6.cjs +1 -0
- package/dist/{chunk-3YCFMGRB.js → chunk-DEZZUYE2.js} +1 -1
- package/dist/chunk-DWF2R5GD.cjs +1 -0
- package/dist/chunk-E55EQK2U.cjs +1 -0
- package/dist/chunk-E74U6CYP.cjs +1 -0
- package/dist/{chunk-XC3QHAK2.cjs → chunk-EL6A35UR.cjs} +1 -1
- package/dist/chunk-F6IPNNSJ.cjs +1 -0
- package/dist/chunk-FJZGG54N.cjs +1 -0
- package/dist/chunk-FWCKOJZM.js +1 -0
- package/dist/{chunk-IMCLPT5V.cjs → chunk-FWHNWL2P.cjs} +1 -1
- package/dist/chunk-GGEADHZO.js +1 -0
- package/dist/{chunk-IRGE5W7L.js → chunk-GQR4R5WY.js} +1 -1
- package/dist/chunk-H66AC7GK.cjs +1 -0
- package/dist/{chunk-M47QIBXI.cjs → chunk-HQWOFR56.cjs} +1 -1
- package/dist/{chunk-VCFXNV3Q.cjs → chunk-HYRQMTRH.cjs} +1 -1
- package/dist/{chunk-EUANTHVN.js → chunk-IRFL4MAX.js} +1 -1
- package/dist/{chunk-GGWPB23G.cjs → chunk-IVL7CKVH.cjs} +1 -1
- package/dist/chunk-IZPBKKPO.js +1 -0
- package/dist/chunk-JBQMXC5I.cjs +1 -0
- package/dist/chunk-JEQEF5WD.js +1 -0
- package/dist/chunk-JMJQCN74.js +1 -0
- package/dist/chunk-JYQTCICM.js +1 -0
- package/dist/chunk-KVAL5PAG.cjs +1 -0
- package/dist/chunk-LS6U7FAY.cjs +1 -0
- package/dist/chunk-NBZWMBO6.js +1 -0
- package/dist/chunk-NRF6LWBC.cjs +1 -0
- package/dist/chunk-OI5XKNZO.js +1 -0
- package/dist/chunk-OYTYSY7G.js +1 -0
- package/dist/chunk-PET42Z7W.js +1 -0
- package/dist/chunk-PZQ6I4JJ.cjs +1 -0
- package/dist/chunk-QBKAEVYG.js +1 -0
- package/dist/{chunk-YV3K2EKJ.js → chunk-RIPKY4RU.js} +1 -1
- package/dist/chunk-RZW35UN5.cjs +1 -0
- package/dist/chunk-SBFNXGTJ.js +1 -0
- package/dist/{chunk-T4CIAKEK.js → chunk-SBKGWRS5.js} +1 -1
- package/dist/{chunk-5Z2G23WP.js → chunk-SIM77PU4.js} +1 -1
- package/dist/chunk-T2T7K3KR.js +1 -0
- package/dist/chunk-T7PU2V7X.cjs +1 -0
- package/dist/chunk-V45XJKHW.cjs +1 -0
- package/dist/chunk-W2WNBUDE.js +1 -0
- package/dist/chunk-XABCB3Y7.cjs +1 -0
- package/dist/chunk-XEDXFSGI.js +1 -0
- package/dist/chunk-YKPSRP5G.js +1 -0
- package/dist/chunk-YLA3DURS.cjs +1 -0
- package/dist/chunk-ZETAZZLD.cjs +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +515 -321
- package/dist/conversions/index.js +1 -1
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +25 -20
- package/dist/events/index.js +1 -1
- package/dist/{extends-Bk_SBGdT.d.ts → extends-DtdRjDyU.d.ts} +63 -87
- package/dist/{formatting → formatters}/index.cjs +1 -1
- package/dist/formatters/index.d.ts +2106 -0
- package/dist/formatters/index.js +1 -0
- package/dist/generators/index.cjs +1 -0
- package/dist/{generator → generators}/index.d.ts +57 -59
- package/dist/generators/index.js +1 -0
- package/dist/{if-CvT4R7Kh.d.ts → if-ChM35c_q.d.ts} +6 -5
- package/dist/index.d.ts +14 -0
- package/dist/{is-array--YjXV-Wx.d.ts → is-array-BJeHxPM3.d.ts} +287 -542
- package/dist/{isPlainObject-BVhBAPHX.d.ts → isPlainObject-DGJkcFYw.d.ts} +6 -6
- package/dist/{never-BfayMBF9.d.ts → never-D89PbPh5.d.ts} +10 -19
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.d.ts +15 -12
- package/dist/next/index.js +1 -1
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +1 -1
- package/dist/next/server/index.js +1 -1
- package/dist/{nils-DMz3kU7M.d.ts → nils-CO8zLHSB.d.ts} +39 -65
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +4 -4
- package/dist/operations/index.js +1 -1
- package/dist/or-C6qzKt2I.d.ts +82 -0
- package/dist/override-CL2olHE5.d.ts +59 -0
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.js +1 -1
- package/dist/pick-BSMX6Xe2.d.ts +15 -0
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +425 -106
- package/dist/predicates/index.js +1 -1
- package/dist/prettify-3o8_Kw6b.d.ts +564 -0
- package/dist/promises/index.cjs +1 -0
- package/dist/promises/index.d.ts +107 -0
- package/dist/promises/index.js +1 -0
- package/dist/promises-LU7K00H0.d.ts +72 -0
- package/dist/rzl-utils.global.js +1 -1
- package/dist/{string-XA-til3C.d.ts → string-B1jlOnws.d.ts} +82 -121
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +209 -210
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +1 -1
- package/dist/tailwind/index.d.ts +23 -17
- package/dist/tailwind/index.js +1 -1
- package/dist/types/index.d.ts +899 -1181
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +113 -108
- package/dist/urls/index.js +1 -1
- package/package.json +33 -40
- package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +0 -26
- package/dist/chunk-2HSNUPEO.cjs +0 -1
- package/dist/chunk-4Z75R3IT.cjs +0 -1
- package/dist/chunk-AJ25PWXX.cjs +0 -1
- package/dist/chunk-BHIBDDQF.js +0 -1
- package/dist/chunk-CE4JI2YB.js +0 -1
- package/dist/chunk-CMJ6UYWW.cjs +0 -1
- package/dist/chunk-D3VSHABU.cjs +0 -1
- package/dist/chunk-DG2GWBTS.cjs +0 -1
- package/dist/chunk-EKS4IZJR.cjs +0 -1
- package/dist/chunk-EOZKYR5S.cjs +0 -1
- package/dist/chunk-EW3I4O7X.js +0 -1
- package/dist/chunk-F3E77L46.js +0 -1
- package/dist/chunk-G5LXIEFO.js +0 -0
- package/dist/chunk-GVWGQNLF.js +0 -1
- package/dist/chunk-H3FXL4DU.cjs +0 -1
- package/dist/chunk-HHPDLSX2.cjs +0 -1
- package/dist/chunk-JARPXKBM.cjs +0 -1
- package/dist/chunk-JFJUPYDT.cjs +0 -1
- package/dist/chunk-JLP56WSM.js +0 -1
- package/dist/chunk-K3MV4AIN.cjs +0 -1
- package/dist/chunk-KOVO72OM.js +0 -1
- package/dist/chunk-LJ4M3VGE.js +0 -1
- package/dist/chunk-LJVGJLP4.js +0 -1
- package/dist/chunk-MISCBZJC.js +0 -1
- package/dist/chunk-MMSYCIJ2.cjs +0 -1
- package/dist/chunk-OLPKAX7F.cjs +0 -1
- package/dist/chunk-ORZFHBEY.js +0 -1
- package/dist/chunk-OWV2P376.js +0 -1
- package/dist/chunk-RV2WK5E6.js +0 -1
- package/dist/chunk-SBF43G3B.cjs +0 -1
- package/dist/chunk-X74TUJSE.cjs +0 -1
- package/dist/chunk-XLDAIZRK.js +0 -1
- package/dist/chunk-XZJ7C4N6.js +0 -1
- package/dist/chunk-ZHV5ZYVN.cjs +0 -1
- package/dist/chunk-ZL7J6GTP.js +0 -1
- package/dist/chunk-ZTCLKKMB.js +0 -1
- package/dist/env/index.cjs +0 -1
- package/dist/env/index.d.ts +0 -16
- package/dist/env/index.js +0 -1
- package/dist/formatting/index.d.ts +0 -950
- package/dist/formatting/index.js +0 -1
- package/dist/generator/index.cjs +0 -1
- package/dist/generator/index.js +0 -1
- package/dist/omit-VvmIsZmX.d.ts +0 -28
- package/dist/prettify-C4xLcYOP.d.ts +0 -353
- package/dist/promise/index.cjs +0 -1
- package/dist/promise/index.d.ts +0 -31
- package/dist/promise/index.js +0 -1
- package/dist/type-data-DDs-u2kq.d.ts +0 -261
- /package/dist/{chunk-5C2SMIGX.cjs → chunk-BAV5T2E3.cjs} +0 -0
- /package/dist/{chunk-MC3LXMCQ.js → chunk-L5RDAVVH.js} +0 -0
- /package/dist/{chunk-J2RGTPGK.cjs → chunk-VJDDGRIK.cjs} +0 -0
- /package/dist/{chunk-FIAAX3UE.js → chunk-YWHHVDT4.js} +0 -0
package/dist/strings/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as Nilable}from'../nils-
|
|
1
|
+
import{c as Nilable}from'../nils-CO8zLHSB.js';import{E as Extends}from'../extends-DtdRjDyU.js';import'../if-ChM35c_q.js';import'../never-D89PbPh5.js';type CapitalizeFirstOptions={
|
|
2
2
|
/** If true **(default)**, the rest of the string will be converted to lowercase after capitalizing the first letter.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* @default true
|
|
5
5
|
*/
|
|
6
6
|
lowerCaseNextRest?:boolean;
|
|
7
7
|
/** If true, the string will trimmed, default: `false`.
|
|
@@ -20,20 +20,20 @@ trim?:boolean;};
|
|
|
20
20
|
* @returns {string} The processed string, returns `""` if input is `null`, `undefined`, or `not a valid string`.
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
23
|
-
* capitalizeFirst(" hello WORLD ")
|
|
23
|
+
* capitalizeFirst(" hello WORLD ");
|
|
24
24
|
* // ➔ " Hello world"
|
|
25
|
-
* capitalizeFirst(" hello WORLD ", { trim: true })
|
|
25
|
+
* capitalizeFirst(" hello WORLD ", { trim: true });
|
|
26
26
|
* // ➔ "Hello world"
|
|
27
|
-
* capitalizeFirst("FOO", { lowerCaseNextRest: false })
|
|
27
|
+
* capitalizeFirst("FOO", { lowerCaseNextRest: false });
|
|
28
28
|
* // ➔ "FOO"
|
|
29
|
-
* capitalizeFirst(" foo BAR ", { trim: true, lowerCaseNextRest: false })
|
|
29
|
+
* capitalizeFirst(" foo BAR ", { trim: true, lowerCaseNextRest: false });
|
|
30
30
|
* // ➔ "Foo BAR"
|
|
31
31
|
* ```
|
|
32
32
|
* #### ℹ️ If null, undefined, or not a valid string input, return `""`.
|
|
33
33
|
* ```ts
|
|
34
|
-
* capitalizeFirst(123)
|
|
35
|
-
* capitalizeFirst(null)
|
|
36
|
-
* capitalizeFirst(undefined)
|
|
34
|
+
* capitalizeFirst(123);
|
|
35
|
+
* capitalizeFirst(null);
|
|
36
|
+
* capitalizeFirst(undefined);
|
|
37
37
|
* // ➔ ""
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
@@ -53,10 +53,10 @@ collapseSpaces?:boolean;};
|
|
|
53
53
|
* ----------------------------------------------------------
|
|
54
54
|
* **Capitalizes the first letter of each word in a string while converting the rest to lowercase.**
|
|
55
55
|
* @param {string | null | undefined} value
|
|
56
|
-
* The input string to be processed
|
|
56
|
+
* ***The input string to be processed.***
|
|
57
57
|
* - If `null` or `undefined`, returns an empty-string (`""`).
|
|
58
58
|
* @param {CapitalizeWordsOptions} [options]
|
|
59
|
-
* Optional settings to control the output
|
|
59
|
+
* ***Optional settings to control the output:***
|
|
60
60
|
* - `trim`: If `true`, removes leading and trailing spaces, defaultValue: `false`.
|
|
61
61
|
* - `collapseSpaces`: If `true`, collapses multiple spaces **between words** into a single space (while preserving leading/trailing spaces), defaultValue: `false`.
|
|
62
62
|
* @returns {string} A new string where each word starts with an uppercase letter
|
|
@@ -85,28 +85,83 @@ declare const capitalizeWords:(value:string|null|undefined,options?:CapitalizeWo
|
|
|
85
85
|
/** --------------------------------------------------
|
|
86
86
|
* * ***Represents a string input.***
|
|
87
87
|
* --------------------------------------------------
|
|
88
|
-
*
|
|
89
88
|
* - **Can be one of:**
|
|
90
89
|
* - A single `string`
|
|
91
90
|
* - An array of strings (`string[]`)
|
|
92
91
|
* - A readonly array of strings (`readonly string[]`)
|
|
93
92
|
* - `null` or `undefined`
|
|
94
|
-
*
|
|
95
93
|
* @template T - A string or array of strings.
|
|
94
|
+
* @private ***types input for {@link toCamelCase}, {@link toPascalCaseSpace}, {@link toPascalCase}, {@link toLowerCase}, {@link toKebabCase}, {@link toSnakeCase}, {@link toDotCase} and {@link slugify}.***
|
|
96
95
|
*/
|
|
97
96
|
type StringLike=Nilable<string|string[]|ReadonlyArray<string>>;
|
|
98
97
|
/** --------------------------------------------------
|
|
99
98
|
* * ***Represents a collection of strings.***
|
|
100
99
|
* --------------------------------------------------
|
|
101
|
-
*
|
|
102
100
|
* - **Can be one of:**
|
|
103
101
|
* - A single `string`
|
|
104
102
|
* - An array of strings (`string[]`)
|
|
105
103
|
* - A readonly array of strings (`readonly string[]`)
|
|
106
104
|
* - A `Set<string>`
|
|
107
105
|
* - A `ReadonlySet<string>`
|
|
106
|
+
* @private ***types options for {@link toCamelCase}, {@link toPascalCaseSpace}, {@link toPascalCase}, {@link toLowerCase}, {@link toKebabCase}, {@link toSnakeCase}, {@link toDotCase} and {@link slugify}.***
|
|
108
107
|
*/
|
|
109
108
|
type StringCollection=string|string[]|ReadonlyArray<string>|Set<string>|ReadonlySet<string>;
|
|
109
|
+
/** ----------------------------------------------------------
|
|
110
|
+
* * ***Utility: `slugify`.***
|
|
111
|
+
* ----------------------------------------------------------
|
|
112
|
+
* **Slugifies a string (or array of strings) for safe use in URLs, with optionally leaving specific words unchanged.**
|
|
113
|
+
* - **Behavior:**
|
|
114
|
+
* - Accepts a `string` or an `array of strings`:
|
|
115
|
+
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
116
|
+
* then joined with `"-"` before conversion.
|
|
117
|
+
* - Splits the input by non-alphanumeric characters
|
|
118
|
+
* (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
|
|
119
|
+
* - The first word is fully lowercase; subsequent words are capitalized.
|
|
120
|
+
* - Words listed in `ignoreWord` remain unchanged in the output.
|
|
121
|
+
* - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
|
|
122
|
+
* - `ignoreWord` accepts:
|
|
123
|
+
* - a single string,
|
|
124
|
+
* - an array of strings, or
|
|
125
|
+
* - a `Set` of strings.
|
|
126
|
+
* - Multiple delimiters collapse into one; empty segments ignored.
|
|
127
|
+
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
128
|
+
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
129
|
+
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
130
|
+
* @returns {string} The slugified string.
|
|
131
|
+
* @example
|
|
132
|
+
* // Basic usage
|
|
133
|
+
* slugify("Hello World!");
|
|
134
|
+
* // ➔ "hello-world"
|
|
135
|
+
*
|
|
136
|
+
* // Array input is joined before conversion
|
|
137
|
+
* slugify(["Join", "Words", "Here"]);
|
|
138
|
+
* // ➔ "join-words-here"
|
|
139
|
+
*
|
|
140
|
+
* // Trims and cleans input
|
|
141
|
+
* slugify(" --- Convert to Slug? --- ");
|
|
142
|
+
* // ➔ "convert-to-slug"
|
|
143
|
+
*
|
|
144
|
+
* // Ignore single word
|
|
145
|
+
* slugify("This URL path", "URL");
|
|
146
|
+
* // ➔ "this-URL-path"
|
|
147
|
+
*
|
|
148
|
+
* // Ignore multiple words
|
|
149
|
+
* slugify("ignore API and URL", ["API", "URL"]);
|
|
150
|
+
* // ➔ "ignore-API-and-URL"
|
|
151
|
+
*
|
|
152
|
+
* // Ignore using Set
|
|
153
|
+
* slugify("ignore API and URL", new Set(["API", "URL"]));
|
|
154
|
+
* // ➔ "ignore-API-and-URL"
|
|
155
|
+
*
|
|
156
|
+
* // Supports emojis and symbols
|
|
157
|
+
* slugify("🔥 Fire_and_ice ❄️");
|
|
158
|
+
* // ➔ "fire-and-ice"
|
|
159
|
+
*
|
|
160
|
+
* // Null, Undefined or empty (string or array) input returns empty string
|
|
161
|
+
* slugify(undefined);
|
|
162
|
+
* // ➔ ""
|
|
163
|
+
*/
|
|
164
|
+
declare const slugify:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
110
165
|
/** ----------------------------------------------------------
|
|
111
166
|
* * ***Utility: `toCamelCase`.***
|
|
112
167
|
* ----------------------------------------------------------
|
|
@@ -160,9 +215,9 @@ type StringCollection=string|string[]|ReadonlyArray<string>|Set<string>|Readonly
|
|
|
160
215
|
*/
|
|
161
216
|
declare const toCamelCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
162
217
|
/** ----------------------------------------------------------
|
|
163
|
-
* * ***Utility: `
|
|
218
|
+
* * ***Utility: `toDotCase`.***
|
|
164
219
|
* ----------------------------------------------------------
|
|
165
|
-
* **Converts a string (or array of strings) into `
|
|
220
|
+
* **Converts a string (or array of strings) into `dot.case`, with optionally leaving specific words unchanged.**
|
|
166
221
|
* - **Behavior:**
|
|
167
222
|
* - Accepts a `string` or an `array of strings`:
|
|
168
223
|
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
@@ -180,49 +235,49 @@ declare const toCamelCase:(input:StringLike,ignoreWord?:StringCollection)=>strin
|
|
|
180
235
|
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
181
236
|
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
182
237
|
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
183
|
-
* @returns {string} The
|
|
238
|
+
* @returns {string} The dot.case formatted string.
|
|
184
239
|
* @example
|
|
185
240
|
* // Basic usage
|
|
186
|
-
*
|
|
187
|
-
* // ➔ "
|
|
241
|
+
* toDotCase("Hello World");
|
|
242
|
+
* // ➔ "hello.world"
|
|
188
243
|
*
|
|
189
244
|
* // Array input is joined before conversion
|
|
190
|
-
*
|
|
191
|
-
* // ➔ "
|
|
245
|
+
* toDotCase(["Join", "Words", "Here"]);
|
|
246
|
+
* // ➔ "join.words.here"
|
|
192
247
|
*
|
|
193
248
|
* // Handles underscores and hyphens
|
|
194
|
-
*
|
|
195
|
-
* // ➔ "
|
|
249
|
+
* toDotCase("convert-to_dot case");
|
|
250
|
+
* // ➔ "convert.to.dot.case"
|
|
196
251
|
*
|
|
197
|
-
* //
|
|
198
|
-
*
|
|
199
|
-
* // ➔ "
|
|
252
|
+
* // Multiple delimiters and trimming
|
|
253
|
+
* toDotCase("___Hello--World__ again!!");
|
|
254
|
+
* // ➔ "hello.world.again"
|
|
200
255
|
*
|
|
201
256
|
* // Supports emojis and symbols
|
|
202
|
-
*
|
|
203
|
-
* // ➔ "
|
|
257
|
+
* toDotCase("🔥Fire_and-ice❄️");
|
|
258
|
+
* // ➔ "fire.and.ice"
|
|
204
259
|
*
|
|
205
260
|
* // Ignore single word
|
|
206
|
-
*
|
|
207
|
-
* // ➔ "
|
|
261
|
+
* toDotCase("this URL path", "URL");
|
|
262
|
+
* // ➔ "this.URL.path"
|
|
208
263
|
*
|
|
209
264
|
* // Ignore multiple words
|
|
210
|
-
*
|
|
211
|
-
* // ➔ "
|
|
265
|
+
* toDotCase("ignore API and URL", ["API", "URL"]);
|
|
266
|
+
* // ➔ "ignore.API.and.URL"
|
|
212
267
|
*
|
|
213
268
|
* // Ignore using Set
|
|
214
|
-
*
|
|
215
|
-
* // ➔ "
|
|
269
|
+
* toDotCase("ignore API and URL", new Set(["API", "URL"]));
|
|
270
|
+
* // ➔ "ignore.API.and.URL"
|
|
216
271
|
*
|
|
217
272
|
* // Null, Undefined or empty (string or array) input returns empty string
|
|
218
|
-
*
|
|
273
|
+
* toDotCase(undefined);
|
|
219
274
|
* // ➔ ""
|
|
220
275
|
*/
|
|
221
|
-
declare const
|
|
276
|
+
declare const toDotCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
222
277
|
/** ----------------------------------------------------------
|
|
223
|
-
* * ***Utility: `
|
|
278
|
+
* * ***Utility: `toKebabCase`.***
|
|
224
279
|
* ----------------------------------------------------------
|
|
225
|
-
* **Converts a string (or array of strings) into `
|
|
280
|
+
* **Converts a string (or array of strings) into `kebab-case`, with optionally leaving specific words unchanged.**
|
|
226
281
|
* - **Behavior:**
|
|
227
282
|
* - Accepts a `string` or an `array of strings`:
|
|
228
283
|
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
@@ -240,45 +295,41 @@ declare const toPascalCaseSpace:(input:StringLike,ignoreWord?:StringCollection)=
|
|
|
240
295
|
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
241
296
|
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
242
297
|
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
243
|
-
* @returns {string} The
|
|
298
|
+
* @returns {string} The kebab-case formatted string.
|
|
244
299
|
* @example
|
|
245
300
|
* // Basic usage
|
|
246
|
-
*
|
|
247
|
-
* // ➔ "
|
|
301
|
+
* toKebabCase("Hello World");
|
|
302
|
+
* // ➔ "hello-world"
|
|
248
303
|
*
|
|
249
304
|
* // Array input is joined before conversion
|
|
250
|
-
*
|
|
251
|
-
* // ➔ "
|
|
305
|
+
* toKebabCase(["Join", "Words", "Here"]);
|
|
306
|
+
* // ➔ "join-words-here"
|
|
252
307
|
*
|
|
253
308
|
* // Handles underscores and hyphens
|
|
254
|
-
*
|
|
255
|
-
* // ➔ "
|
|
256
|
-
*
|
|
257
|
-
* // Trims extra delimiters
|
|
258
|
-
* toPascalCase("___hello--world__ again!!");
|
|
259
|
-
* // ➔ "HelloWorldAgain"
|
|
309
|
+
* toKebabCase("convert_to-kebab case");
|
|
310
|
+
* // ➔ "convert-to-kebab-case"
|
|
260
311
|
*
|
|
261
|
-
* //
|
|
262
|
-
*
|
|
263
|
-
* // ➔ "
|
|
312
|
+
* // Handles emojis and symbols
|
|
313
|
+
* toKebabCase("🔥fire___and--ice❄️");
|
|
314
|
+
* // ➔ "fire-and-ice"
|
|
264
315
|
*
|
|
265
|
-
* // Ignore
|
|
266
|
-
*
|
|
267
|
-
* // ➔ "
|
|
316
|
+
* // Ignore specific word
|
|
317
|
+
* toKebabCase("ignore URL case", "URL");
|
|
318
|
+
* // ➔ "ignore-URL-case"
|
|
268
319
|
*
|
|
269
320
|
* // Ignore multiple words
|
|
270
|
-
*
|
|
271
|
-
* // ➔ "
|
|
321
|
+
* toKebabCase("ignore API and URL", ["API", "URL"]);
|
|
322
|
+
* // ➔ "ignore-API-and-URL"
|
|
272
323
|
*
|
|
273
|
-
* // Ignore
|
|
274
|
-
*
|
|
275
|
-
* // ➔ "
|
|
324
|
+
* // Ignore with Set
|
|
325
|
+
* toKebabCase("ignore API and URL", new Set(["API", "URL"]));
|
|
326
|
+
* // ➔ "ignore-API-and-URL"
|
|
276
327
|
*
|
|
277
328
|
* // Null, Undefined or empty (string or array) input returns empty string
|
|
278
|
-
*
|
|
329
|
+
* toKebabCase(null);
|
|
279
330
|
* // ➔ ""
|
|
280
331
|
*/
|
|
281
|
-
declare const
|
|
332
|
+
declare const toKebabCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
282
333
|
/** ----------------------------------------------------------
|
|
283
334
|
* * ***Utility: `toLowerCase`.***
|
|
284
335
|
* ----------------------------------------------------------
|
|
@@ -340,9 +391,9 @@ declare const toPascalCase:(input:StringLike,ignoreWord?:StringCollection)=>stri
|
|
|
340
391
|
*/
|
|
341
392
|
declare const toLowerCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
342
393
|
/** ----------------------------------------------------------
|
|
343
|
-
* * ***Utility: `
|
|
394
|
+
* * ***Utility: `toPascalCase`.***
|
|
344
395
|
* ----------------------------------------------------------
|
|
345
|
-
* **Converts a string (or array of strings) into `
|
|
396
|
+
* **Converts a string (or array of strings) into `PascalCase`, with optionally leaving specific words unchanged.**
|
|
346
397
|
* - **Behavior:**
|
|
347
398
|
* - Accepts a `string` or an `array of strings`:
|
|
348
399
|
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
@@ -360,101 +411,49 @@ declare const toLowerCase:(input:StringLike,ignoreWord?:StringCollection)=>strin
|
|
|
360
411
|
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
361
412
|
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
362
413
|
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
363
|
-
* @returns {string} The
|
|
414
|
+
* @returns {string} The PascalCase formatted string.
|
|
364
415
|
* @example
|
|
365
416
|
* // Basic usage
|
|
366
|
-
*
|
|
367
|
-
* // ➔ "
|
|
417
|
+
* toPascalCase("hello world");
|
|
418
|
+
* // ➔ "HelloWorld"
|
|
368
419
|
*
|
|
369
420
|
* // Array input is joined before conversion
|
|
370
|
-
*
|
|
371
|
-
* // ➔ "
|
|
421
|
+
* toPascalCase(["Join", "Words", "Here"]);
|
|
422
|
+
* // ➔ "JoinWordsHere"
|
|
372
423
|
*
|
|
373
424
|
* // Handles underscores and hyphens
|
|
374
|
-
*
|
|
375
|
-
* // ➔ "
|
|
376
|
-
*
|
|
377
|
-
* // Handles emojis and symbols
|
|
378
|
-
* toKebabCase("🔥fire___and--ice❄️");
|
|
379
|
-
* // ➔ "fire-and-ice"
|
|
380
|
-
*
|
|
381
|
-
* // Ignore specific word
|
|
382
|
-
* toKebabCase("ignore URL case", "URL");
|
|
383
|
-
* // ➔ "ignore-URL-case"
|
|
384
|
-
*
|
|
385
|
-
* // Ignore multiple words
|
|
386
|
-
* toKebabCase("ignore API and URL", ["API", "URL"]);
|
|
387
|
-
* // ➔ "ignore-API-and-URL"
|
|
388
|
-
*
|
|
389
|
-
* // Ignore with Set
|
|
390
|
-
* toKebabCase("ignore API and URL", new Set(["API", "URL"]));
|
|
391
|
-
* // ➔ "ignore-API-and-URL"
|
|
392
|
-
*
|
|
393
|
-
* // Null, Undefined or empty (string or array) input returns empty string
|
|
394
|
-
* toKebabCase(null);
|
|
395
|
-
* // ➔ ""
|
|
396
|
-
*/
|
|
397
|
-
declare const toKebabCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
398
|
-
/** ----------------------------------------------------------
|
|
399
|
-
* * ***Utility: `toSnakeCase`.***
|
|
400
|
-
* ----------------------------------------------------------
|
|
401
|
-
* **Converts a string (or array of strings) into `snake_case`, with optionally leaving specific words unchanged.**
|
|
402
|
-
* - **Behavior:**
|
|
403
|
-
* - Accepts a `string` or an `array of strings`:
|
|
404
|
-
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
405
|
-
* then joined with `"-"` before conversion.
|
|
406
|
-
* - Splits the input by non-alphanumeric characters
|
|
407
|
-
* (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
|
|
408
|
-
* - The first word is fully lowercase; subsequent words are capitalized.
|
|
409
|
-
* - Words listed in `ignoreWord` remain unchanged in the output.
|
|
410
|
-
* - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
|
|
411
|
-
* - `ignoreWord` accepts:
|
|
412
|
-
* - a single string,
|
|
413
|
-
* - an array of strings, or
|
|
414
|
-
* - a `Set` of strings.
|
|
415
|
-
* - Multiple delimiters collapse into one; empty segments ignored.
|
|
416
|
-
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
417
|
-
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
418
|
-
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
419
|
-
* @returns {string} The snake_case formatted string.
|
|
420
|
-
* @example
|
|
421
|
-
* // Basic usage
|
|
422
|
-
* toSnakeCase("Hello World");
|
|
423
|
-
* // ➔ "hello_world"
|
|
424
|
-
*
|
|
425
|
-
* // Array input is joined before conversion
|
|
426
|
-
* toSnakeCase(["Join", "Words", "Here"]);
|
|
427
|
-
* // ➔ "join_words_here"
|
|
425
|
+
* toPascalCase("convert_to-pascal case");
|
|
426
|
+
* // ➔ "ConvertToPascalCase"
|
|
428
427
|
*
|
|
429
|
-
* //
|
|
430
|
-
*
|
|
431
|
-
* // ➔ "
|
|
428
|
+
* // Trims extra delimiters
|
|
429
|
+
* toPascalCase("___hello--world__ again!!");
|
|
430
|
+
* // ➔ "HelloWorldAgain"
|
|
432
431
|
*
|
|
433
|
-
* //
|
|
434
|
-
*
|
|
435
|
-
* // ➔ "
|
|
432
|
+
* // Supports emojis and symbols
|
|
433
|
+
* toPascalCase("🔥fire_and-ice❄️");
|
|
434
|
+
* // ➔ "FireAndIce"
|
|
436
435
|
*
|
|
437
|
-
* // Ignore
|
|
438
|
-
*
|
|
439
|
-
* // ➔ "
|
|
436
|
+
* // Ignore single word
|
|
437
|
+
* toPascalCase("this URL path will ignore", "URL");
|
|
438
|
+
* // ➔ "ThisURLPathWillIgnore"
|
|
440
439
|
*
|
|
441
440
|
* // Ignore multiple words
|
|
442
|
-
*
|
|
443
|
-
* // ➔ "
|
|
441
|
+
* toPascalCase("ignore API and URL", ["API", "URL"]);
|
|
442
|
+
* // ➔ "IgnoreAPIAndURL"
|
|
444
443
|
*
|
|
445
|
-
* // Ignore
|
|
446
|
-
*
|
|
447
|
-
* // ➔ "
|
|
444
|
+
* // Ignore using Set
|
|
445
|
+
* toPascalCase("ignore API and URL", new Set(["API", "URL"]));
|
|
446
|
+
* // ➔ "IgnoreAPIAndURL"
|
|
448
447
|
*
|
|
449
448
|
* // Null, Undefined or empty (string or array) input returns empty string
|
|
450
|
-
*
|
|
449
|
+
* toPascalCase(undefined);
|
|
451
450
|
* // ➔ ""
|
|
452
451
|
*/
|
|
453
|
-
declare const
|
|
452
|
+
declare const toPascalCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
454
453
|
/** ----------------------------------------------------------
|
|
455
|
-
* * ***Utility: `
|
|
454
|
+
* * ***Utility: `toPascalCaseSpace`.***
|
|
456
455
|
* ----------------------------------------------------------
|
|
457
|
-
* **Converts a string (or array of strings) into `
|
|
456
|
+
* **Converts a string (or array of strings) into `PascalCaseSpace`, with optionally leaving specific words unchanged.**
|
|
458
457
|
* - **Behavior:**
|
|
459
458
|
* - Accepts a `string` or an `array of strings`:
|
|
460
459
|
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
@@ -472,49 +471,49 @@ declare const toSnakeCase:(input:StringLike,ignoreWord?:StringCollection)=>strin
|
|
|
472
471
|
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
473
472
|
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
474
473
|
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
475
|
-
* @returns {string} The
|
|
474
|
+
* @returns {string} The PascalCaseSpace formatted string.
|
|
476
475
|
* @example
|
|
477
476
|
* // Basic usage
|
|
478
|
-
*
|
|
479
|
-
* // ➔ "
|
|
477
|
+
* toPascalCaseSpace("hello world");
|
|
478
|
+
* // ➔ "Hello World"
|
|
480
479
|
*
|
|
481
480
|
* // Array input is joined before conversion
|
|
482
|
-
*
|
|
483
|
-
* // ➔ "
|
|
481
|
+
* toPascalCaseSpace(["Join", "Words", "Here"]);
|
|
482
|
+
* // ➔ "Join Words Here"
|
|
484
483
|
*
|
|
485
484
|
* // Handles underscores and hyphens
|
|
486
|
-
*
|
|
487
|
-
* // ➔ "
|
|
485
|
+
* toPascalCaseSpace("convert_to-pascal case");
|
|
486
|
+
* // ➔ "Convert To Pascal Case Space"
|
|
488
487
|
*
|
|
489
|
-
* //
|
|
490
|
-
*
|
|
491
|
-
* // ➔ "
|
|
488
|
+
* // Trims extra delimiters
|
|
489
|
+
* toPascalCaseSpace("___hello--world__ again!!");
|
|
490
|
+
* // ➔ "Hello World Again"
|
|
492
491
|
*
|
|
493
492
|
* // Supports emojis and symbols
|
|
494
|
-
*
|
|
495
|
-
* // ➔ "
|
|
493
|
+
* toPascalCaseSpace("🔥fire_and-ice❄️");
|
|
494
|
+
* // ➔ "Fire And Ice"
|
|
496
495
|
*
|
|
497
496
|
* // Ignore single word
|
|
498
|
-
*
|
|
499
|
-
* // ➔ "
|
|
497
|
+
* toPascalCaseSpace("this URL path will ignore", "URL");
|
|
498
|
+
* // ➔ "This URL Path Will Ignore"
|
|
500
499
|
*
|
|
501
500
|
* // Ignore multiple words
|
|
502
|
-
*
|
|
503
|
-
* // ➔ "
|
|
501
|
+
* toPascalCaseSpace("ignore API and URL", ["API", "URL"]);
|
|
502
|
+
* // ➔ "Ignore API And URL"
|
|
504
503
|
*
|
|
505
504
|
* // Ignore using Set
|
|
506
|
-
*
|
|
507
|
-
* // ➔ "
|
|
505
|
+
* toPascalCaseSpace("ignore API and URL", new Set(["API", "URL"]));
|
|
506
|
+
* // ➔ "Ignore API And URL"
|
|
508
507
|
*
|
|
509
508
|
* // Null, Undefined or empty (string or array) input returns empty string
|
|
510
|
-
*
|
|
509
|
+
* toPascalCaseSpace(undefined);
|
|
511
510
|
* // ➔ ""
|
|
512
511
|
*/
|
|
513
|
-
declare const
|
|
512
|
+
declare const toPascalCaseSpace:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
514
513
|
/** ----------------------------------------------------------
|
|
515
|
-
* * ***Utility: `
|
|
514
|
+
* * ***Utility: `toSnakeCase`.***
|
|
516
515
|
* ----------------------------------------------------------
|
|
517
|
-
* **
|
|
516
|
+
* **Converts a string (or array of strings) into `snake_case`, with optionally leaving specific words unchanged.**
|
|
518
517
|
* - **Behavior:**
|
|
519
518
|
* - Accepts a `string` or an `array of strings`:
|
|
520
519
|
* - If an array is provided, elements are trimmed, empty ones removed,
|
|
@@ -532,41 +531,41 @@ declare const toDotCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
|
|
|
532
531
|
* - Returns `""` if the input is `null`, `undefined`, or empty.
|
|
533
532
|
* @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
|
|
534
533
|
* @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
|
|
535
|
-
* @returns {string} The
|
|
534
|
+
* @returns {string} The snake_case formatted string.
|
|
536
535
|
* @example
|
|
537
536
|
* // Basic usage
|
|
538
|
-
*
|
|
539
|
-
* // ➔ "
|
|
537
|
+
* toSnakeCase("Hello World");
|
|
538
|
+
* // ➔ "hello_world"
|
|
540
539
|
*
|
|
541
540
|
* // Array input is joined before conversion
|
|
542
|
-
*
|
|
543
|
-
* // ➔ "
|
|
541
|
+
* toSnakeCase(["Join", "Words", "Here"]);
|
|
542
|
+
* // ➔ "join_words_here"
|
|
544
543
|
*
|
|
545
|
-
* //
|
|
546
|
-
*
|
|
547
|
-
* // ➔ "
|
|
544
|
+
* // Handles underscores, hyphens, spaces
|
|
545
|
+
* toSnakeCase("convert-to_snake case");
|
|
546
|
+
* // ➔ "convert_to_snake_case"
|
|
548
547
|
*
|
|
549
|
-
* //
|
|
550
|
-
*
|
|
551
|
-
* // ➔ "
|
|
548
|
+
* // Handles emojis and symbols
|
|
549
|
+
* toSnakeCase("🔥fire___and--ice❄️");
|
|
550
|
+
* // ➔ "fire_and_ice"
|
|
552
551
|
*
|
|
553
|
-
* // Ignore
|
|
554
|
-
*
|
|
555
|
-
* // ➔ "
|
|
552
|
+
* // Ignore specific word
|
|
553
|
+
* toSnakeCase("ignore URL case", "URL");
|
|
554
|
+
* // ➔ "ignore_URL_case"
|
|
556
555
|
*
|
|
557
|
-
* // Ignore
|
|
558
|
-
*
|
|
559
|
-
* // ➔ "
|
|
556
|
+
* // Ignore multiple words
|
|
557
|
+
* toSnakeCase("ignore API and URL", ["API", "URL"]);
|
|
558
|
+
* // ➔ "ignore_API_and_URL"
|
|
560
559
|
*
|
|
561
|
-
* //
|
|
562
|
-
*
|
|
563
|
-
* // ➔ "
|
|
560
|
+
* // Ignore with Set
|
|
561
|
+
* toSnakeCase("ignore API and URL", new Set(["API", "URL"]));
|
|
562
|
+
* // ➔ "ignore_API_and_URL"
|
|
564
563
|
*
|
|
565
564
|
* // Null, Undefined or empty (string or array) input returns empty string
|
|
566
|
-
*
|
|
565
|
+
* toSnakeCase(null);
|
|
567
566
|
* // ➔ ""
|
|
568
567
|
*/
|
|
569
|
-
declare const
|
|
568
|
+
declare const toSnakeCase:(input:StringLike,ignoreWord?:StringCollection)=>string;type NormalizeSpacesOptions={
|
|
570
569
|
/** If `true`, skips normalization and only trims whitespace from start & end, defaultValue: `false`.
|
|
571
570
|
*
|
|
572
571
|
* @default false
|
|
@@ -681,6 +680,30 @@ declare const removeSpaces:(value:string|null|undefined,options?:RemoveSpacesOpt
|
|
|
681
680
|
* // ➔ undefined
|
|
682
681
|
*/
|
|
683
682
|
declare function stripHtmlTags(input:string):string;declare function stripHtmlTags<T>(input:T):Extends<string,T>extends true?string|undefined:undefined;
|
|
683
|
+
/** ----------------------------------------------------------
|
|
684
|
+
* * ***Utility: `getInitialsName`.***
|
|
685
|
+
* ----------------------------------------------------------
|
|
686
|
+
* **Extracts initials from the given name string.**
|
|
687
|
+
* - **Behavior:**
|
|
688
|
+
* - For names with two or more words, returns the first letter of the first and second words.
|
|
689
|
+
* - For a single word with 2+ characters, returns the first two letters.
|
|
690
|
+
* - For a single character, returns that character.
|
|
691
|
+
* - For `empty`, `null`, `undefined` or `whitespace-only input`, returns an empty string (`""`).
|
|
692
|
+
* @param {string | null | undefined} name - The name to extract initials from.
|
|
693
|
+
* @returns {string} The extracted initials (e.g., "JD" for "John Doe").
|
|
694
|
+
* @example
|
|
695
|
+
* getInitialsName("Alice"); // ➔ "AL"
|
|
696
|
+
* getInitialsName("John Doe"); // ➔ "JD"
|
|
697
|
+
* getInitialsName(" Bob Marley "); // ➔ "BM"
|
|
698
|
+
* getInitialsName("John Ronald Donal"); // ➔ "JR"
|
|
699
|
+
* getInitialsName("Lord John Doe Moe"); // ➔ "LJ"
|
|
700
|
+
* getInitialsName("X"); // ➔ "X"
|
|
701
|
+
* getInitialsName(""); // ➔ "" (empty string)
|
|
702
|
+
* getInitialsName(" "); // ➔ "" (empty string)
|
|
703
|
+
* getInitialsName(null); // ➔ "" (null input)
|
|
704
|
+
* getInitialsName(undefined); // ➔ "" (undefined input)
|
|
705
|
+
*/
|
|
706
|
+
declare const getInitialsName:(name:string|null|undefined)=>string;
|
|
684
707
|
/** ----------------------------------------------------------
|
|
685
708
|
* * ***Utility: `replaceAt`.***
|
|
686
709
|
* ----------------------------------------------------------
|
|
@@ -714,28 +737,4 @@ declare function stripHtmlTags(input:string):string;declare function stripHtmlTa
|
|
|
714
737
|
* replaceAt(2, null, "X");
|
|
715
738
|
* // ➔ ❌ TypeError: First parameter `index` must be of type `number`, second parameter `originalString` and third parameter `replaceTo` must be of type `string`, but received: "['index': `string`,...]."
|
|
716
739
|
*/
|
|
717
|
-
declare const replaceAt:(index:number,originalString:string,replaceTo:string)=>string;
|
|
718
|
-
/** ----------------------------------------------------------
|
|
719
|
-
* * ***Utility: `getInitialsName`.***
|
|
720
|
-
* ----------------------------------------------------------
|
|
721
|
-
* **Extracts initials from the given name string.**
|
|
722
|
-
* - **Behavior:**
|
|
723
|
-
* - For names with two or more words, returns the first letter of the first and second words.
|
|
724
|
-
* - For a single word with 2+ characters, returns the first two letters.
|
|
725
|
-
* - For a single character, returns that character.
|
|
726
|
-
* - For `empty`, `null`, `undefined` or `whitespace-only input`, returns an empty string (`""`).
|
|
727
|
-
* @param {string | null | undefined} name - The name to extract initials from.
|
|
728
|
-
* @returns {string} The extracted initials (e.g., "JD" for "John Doe").
|
|
729
|
-
* @example
|
|
730
|
-
* getInitialsName("Alice"); // ➔ "AL"
|
|
731
|
-
* getInitialsName("John Doe"); // ➔ "JD"
|
|
732
|
-
* getInitialsName(" Bob Marley "); // ➔ "BM"
|
|
733
|
-
* getInitialsName("John Ronald Donal"); // ➔ "JR"
|
|
734
|
-
* getInitialsName("Lord John Doe Moe"); // ➔ "LJ"
|
|
735
|
-
* getInitialsName("X"); // ➔ "X"
|
|
736
|
-
* getInitialsName(""); // ➔ "" (empty string)
|
|
737
|
-
* getInitialsName(" "); // ➔ "" (empty string)
|
|
738
|
-
* getInitialsName(null); // ➔ "" (null input)
|
|
739
|
-
* getInitialsName(undefined); // ➔ "" (undefined input)
|
|
740
|
-
*/
|
|
741
|
-
declare const getInitialsName:(name:string|null|undefined)=>string;export{capitalizeFirst,capitalizeWords,getInitialsName,normalizeSpaces,normalizeString,removeSpaces,replaceAt,slugify,stripHtmlTags,toCamelCase,toDotCase,toKebabCase,toLowerCase,toPascalCase,toPascalCaseSpace,toSnakeCase};
|
|
740
|
+
declare const replaceAt:(index:number,originalString:string,replaceTo:string)=>string;export{capitalizeFirst,capitalizeWords,getInitialsName,normalizeSpaces,normalizeString,removeSpaces,replaceAt,slugify,stripHtmlTags,toCamelCase,toDotCase,toKebabCase,toLowerCase,toPascalCase,toPascalCaseSpace,toSnakeCase};
|
package/dist/strings/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getInitialsName,replaceAt}from"../chunk-
|
|
1
|
+
export{capitalizeFirst,capitalizeWords,getInitialsName,replaceAt,stripHtmlTags}from"../chunk-JEQEF5WD.js";export{normalizeString}from"../chunk-IZPBKKPO.js";export{normalizeSpaces}from"../chunk-T2T7K3KR.js";export{removeSpaces}from"../chunk-XEDXFSGI.js";import"../chunk-W2WNBUDE.js";export{slugify,toCamelCase,toDotCase,toKebabCase,toLowerCase,toPascalCase,toPascalCaseSpace,toSnakeCase}from"../chunk-CMW2TBOQ.js";
|
package/dist/tailwind/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-YLA3DURS.cjs");require("../chunk-6JFZL7YE.cjs"),require("../chunk-PZQ6I4JJ.cjs"),Object.defineProperty(exports,"cnV3",{enumerable:!0,get:function(){return e.cnV3}}),Object.defineProperty(exports,"cnV4",{enumerable:!0,get:function(){return e.cnV4}}),Object.defineProperty(exports,"customCnV3",{enumerable:!0,get:function(){return e.customCnV3}}),Object.defineProperty(exports,"customCnV4",{enumerable:!0,get:function(){return e.customCnV4}}),Object.defineProperty(exports,"shouldForwardProp",{enumerable:!0,get:function(){return e.shouldForwardProp}}),Object.defineProperty(exports,"twMergeDefaultV3",{enumerable:!0,get:function(){return e.twMergeDefaultV3}}),Object.defineProperty(exports,"twMergeDefaultV4",{enumerable:!0,get:function(){return e.twMergeDefaultV4}});
|