@rzl-zone/utils-js 3.0.1-beta.0 → 3.1.0-beta.2

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 (152) hide show
  1. package/dist/assertions/index.cjs +1 -1
  2. package/dist/assertions/index.d.ts +96 -116
  3. package/dist/assertions/index.js +1 -1
  4. package/dist/chunk-25G6B35W.js +1 -0
  5. package/dist/chunk-2AUUPGMN.js +1 -0
  6. package/dist/chunk-2JQQQ625.js +1 -0
  7. package/dist/chunk-445TAVT4.cjs +1 -0
  8. package/dist/chunk-467VEMJH.js +1 -0
  9. package/dist/chunk-6Q4I2RPC.cjs +1 -0
  10. package/dist/chunk-6SMJMZ7G.cjs +1 -0
  11. package/dist/chunk-BLCANGFS.js +1 -0
  12. package/dist/chunk-CK3BZGEU.js +1 -0
  13. package/dist/{chunk-JWHM3WZQ.cjs → chunk-D43GV6EF.cjs} +1 -1
  14. package/dist/chunk-DFSTVQFI.cjs +1 -0
  15. package/dist/chunk-DYRDBYPF.cjs +1 -0
  16. package/dist/chunk-EXXLUO7L.cjs +1 -0
  17. package/dist/chunk-G72VSVGO.js +1 -0
  18. package/dist/chunk-GAJTFCUA.js +1 -0
  19. package/dist/chunk-GOJNH55O.cjs +1 -0
  20. package/dist/chunk-HXST7RJB.js +1 -0
  21. package/dist/{chunk-BYZAD3XN.cjs → chunk-HXTACM3O.cjs} +1 -1
  22. package/dist/chunk-IJTZWWRJ.cjs +1 -0
  23. package/dist/chunk-ISJ33O2J.cjs +1 -0
  24. package/dist/chunk-JISH2VGG.js +1 -0
  25. package/dist/{chunk-FF76ISQ2.js → chunk-JQZUWBIX.js} +1 -1
  26. package/dist/{chunk-XH6MCRLP.js → chunk-K4PLGD7C.js} +1 -1
  27. package/dist/chunk-KZQB7H4E.cjs +1 -0
  28. package/dist/chunk-LUVV5KSD.cjs +2 -0
  29. package/dist/chunk-LVUSFXQS.cjs +1 -0
  30. package/dist/chunk-ME5OV5HN.js +1 -0
  31. package/dist/chunk-MF5Y5K4N.cjs +1 -0
  32. package/dist/chunk-MJAW5RAK.js +1 -0
  33. package/dist/chunk-MWLEM7ED.js +1 -0
  34. package/dist/chunk-NSVLG7NY.js +4 -0
  35. package/dist/chunk-NUHOOAUN.cjs +1 -0
  36. package/dist/chunk-NUVGETPD.js +2 -0
  37. package/dist/chunk-O5VXBNUQ.cjs +4 -0
  38. package/dist/chunk-O7SJR4CY.cjs +1 -0
  39. package/dist/chunk-OX6RLS2F.cjs +1 -0
  40. package/dist/chunk-PFLNHD4B.cjs +1 -0
  41. package/dist/chunk-PSWITZK5.js +1 -0
  42. package/dist/chunk-PYUVKHUF.cjs +1 -0
  43. package/dist/chunk-REFMEB4A.js +1 -0
  44. package/dist/chunk-RHE3M2NJ.cjs +1 -0
  45. package/dist/chunk-RHIBYOFQ.js +1 -0
  46. package/dist/chunk-S7GMG4TB.js +1 -0
  47. package/dist/chunk-TQMZ2LPI.js +1 -0
  48. package/dist/{chunk-RN3TP3S3.js → chunk-U4TZO7WV.js} +1 -1
  49. package/dist/chunk-UUMKL74S.js +1 -0
  50. package/dist/{chunk-EXZ47NOW.js → chunk-VQLAPEL3.js} +1 -1
  51. package/dist/chunk-VTR75UID.cjs +1 -0
  52. package/dist/chunk-XFCJDSB2.cjs +1 -0
  53. package/dist/chunk-XOYX4PLZ.cjs +1 -0
  54. package/dist/chunk-Z6FLCEN6.js +1 -0
  55. package/dist/chunk-ZO5364A6.cjs +1 -0
  56. package/dist/conversions/index.cjs +1 -1
  57. package/dist/conversions/index.d.ts +396 -593
  58. package/dist/conversions/index.js +1 -1
  59. package/dist/env/index.d.ts +5 -8
  60. package/dist/events/index.cjs +1 -1
  61. package/dist/events/index.d.ts +80 -77
  62. package/dist/events/index.js +1 -1
  63. package/dist/{array-CIZRbqTF.d.ts → extends-Bk_SBGdT.d.ts} +145 -1
  64. package/dist/formatting/index.cjs +1 -1
  65. package/dist/formatting/index.d.ts +478 -440
  66. package/dist/formatting/index.js +1 -1
  67. package/dist/generator/index.cjs +1 -1
  68. package/dist/generator/index.d.ts +135 -112
  69. package/dist/generator/index.js +1 -1
  70. package/dist/index.cjs +1 -1
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/{is-array-Ckm_47hw.d.ts → is-array--YjXV-Wx.d.ts} +2 -352
  74. package/dist/{isPlainObject-BKYaI6a8.d.ts → isPlainObject-BVhBAPHX.d.ts} +49 -62
  75. package/dist/next/index.cjs +6 -6
  76. package/dist/next/index.d.ts +125 -105
  77. package/dist/next/index.js +5 -5
  78. package/dist/next/server/index.cjs +1 -1
  79. package/dist/next/server/index.d.ts +8 -22
  80. package/dist/next/server/index.js +1 -1
  81. package/dist/operations/index.cjs +1 -1
  82. package/dist/operations/index.d.ts +72 -127
  83. package/dist/operations/index.js +1 -1
  84. package/dist/parsers/index.cjs +1 -1
  85. package/dist/parsers/index.d.ts +26 -27
  86. package/dist/parsers/index.js +1 -1
  87. package/dist/predicates/index.cjs +1 -1
  88. package/dist/predicates/index.d.ts +686 -660
  89. package/dist/predicates/index.js +1 -1
  90. package/dist/promise/index.cjs +1 -1
  91. package/dist/promise/index.d.ts +14 -23
  92. package/dist/promise/index.js +1 -1
  93. package/dist/rzl-utils.global.js +3 -3
  94. package/dist/string-XA-til3C.d.ts +351 -0
  95. package/dist/strings/index.cjs +1 -1
  96. package/dist/strings/index.d.ts +301 -376
  97. package/dist/strings/index.js +1 -1
  98. package/dist/stylings/index.cjs +1 -1
  99. package/dist/stylings/index.d.ts +15 -23
  100. package/dist/stylings/index.js +1 -1
  101. package/dist/types/index.d.ts +1 -1
  102. package/dist/urls/index.cjs +1 -1
  103. package/dist/urls/index.d.ts +279 -302
  104. package/dist/urls/index.js +1 -1
  105. package/package.json +53 -11
  106. package/dist/chunk-2TRAPBZ7.cjs +0 -1
  107. package/dist/chunk-4DK3RCC4.js +0 -2
  108. package/dist/chunk-4JOQ45HL.js +0 -1
  109. package/dist/chunk-55CZALRS.js +0 -1
  110. package/dist/chunk-62HX5Z45.cjs +0 -1
  111. package/dist/chunk-7NA6DUHR.cjs +0 -2
  112. package/dist/chunk-BVPMMWDL.cjs +0 -1
  113. package/dist/chunk-CEFYHEM4.cjs +0 -1
  114. package/dist/chunk-CN53M4QZ.cjs +0 -1
  115. package/dist/chunk-D47MHBSD.cjs +0 -1
  116. package/dist/chunk-DGH75GJD.js +0 -1
  117. package/dist/chunk-E5NUI7PN.js +0 -1
  118. package/dist/chunk-FDITZ5C6.cjs +0 -1
  119. package/dist/chunk-FSSV24W7.cjs +0 -1
  120. package/dist/chunk-GCGU2WB7.js +0 -1
  121. package/dist/chunk-GECI2YBP.js +0 -1
  122. package/dist/chunk-GQE4OVHC.cjs +0 -1
  123. package/dist/chunk-GRVZXQXL.cjs +0 -1
  124. package/dist/chunk-I4AVNHPA.cjs +0 -1
  125. package/dist/chunk-KBKYG3IY.cjs +0 -1
  126. package/dist/chunk-KCQDDZJE.cjs +0 -1
  127. package/dist/chunk-LVKAYEZ4.js +0 -1
  128. package/dist/chunk-MBDWTK54.cjs +0 -1
  129. package/dist/chunk-MNGGDB2G.js +0 -1
  130. package/dist/chunk-MY7BA4GI.cjs +0 -1
  131. package/dist/chunk-N2IJPIND.cjs +0 -1
  132. package/dist/chunk-NIMNTEGV.js +0 -1
  133. package/dist/chunk-POCPQYZS.js +0 -1
  134. package/dist/chunk-PVJF2JHM.js +0 -1
  135. package/dist/chunk-QCFXEUKL.js +0 -1
  136. package/dist/chunk-QFCGBBSY.js +0 -1
  137. package/dist/chunk-QQYAUPSK.cjs +0 -1
  138. package/dist/chunk-TC4VBE4Y.cjs +0 -1
  139. package/dist/chunk-TUXDINHF.cjs +0 -1
  140. package/dist/chunk-U5Y2FXMN.cjs +0 -1
  141. package/dist/chunk-UUPQI6ND.cjs +0 -1
  142. package/dist/chunk-VYCGZ2S6.js +0 -1
  143. package/dist/chunk-W5EDKJK3.js +0 -1
  144. package/dist/chunk-WHAVUFEU.js +0 -1
  145. package/dist/chunk-X3GTRVVK.cjs +0 -4
  146. package/dist/chunk-XCFIOTCV.js +0 -1
  147. package/dist/chunk-XE27XPJR.js +0 -1
  148. package/dist/chunk-XVB3ZZEB.js +0 -1
  149. package/dist/chunk-YEERJDOF.js +0 -4
  150. package/dist/chunk-ZBSIGJFO.cjs +0 -1
  151. package/dist/chunk-ZYAML74V.js +0 -1
  152. package/dist/extends-Mp81Hq9-.d.ts +0 -145
@@ -1,670 +1,617 @@
1
- import{c as Nilable}from'../nils-DMz3kU7M.js';
2
- /** ----------------------------------------------------------
3
- * * Capitalizes the first letter of a string.
4
- * * Optionally lowercases the rest and trims whitespace.
5
- * ----------------------------------------------------------
6
- *
7
- * @param string - The string to be processed.
8
- * @param options - Options to control behavior.
9
- * @param options.lowerCaseNextRest - If true, lowercases the rest (next first letter) (default: true).
10
- * @param options.trim - If true, trims the string before processing (default: false).
11
- * @returns The processed string. Returns "" if input is null, undefined, or not a valid string.
1
+ import{c as Nilable}from'../nils-DMz3kU7M.js';import{E as Extends}from'../extends-Bk_SBGdT.js';import'../if-CvT4R7Kh.js';import'../never-BfayMBF9.js';type CapitalizeFirstOptions={
2
+ /** If true **(default)**, the rest of the string will be converted to lowercase after capitalizing the first letter.
12
3
  *
13
- * @example
14
- * capitalizeFirst(" hello WORLD ") // " Hello world"
15
- * capitalizeFirst(" hello WORLD ", { trim: true }) // "Hello world"
16
- * capitalizeFirst("FOO", { lowerCaseNextRest: false }) // "FOO"
17
- * capitalizeFirst(" foo BAR ", { trim: true, lowerCaseNextRest: false }) // "Foo BAR"
18
- */
19
- declare const capitalizeFirst:(string?:string|null,options?:{
20
- /**
21
- * @description If true, the rest of the string will be converted to lowercase after capitalizing the first letter.
22
4
  * @default true
23
5
  */
24
6
  lowerCaseNextRest?:boolean;
25
- /**
26
- * @description If true, the string will trimmed.
27
- * @default false
7
+ /** If true, the string will trimmed, default: `false`.
8
+ *
9
+ * @default false
28
10
  */
29
- trim?:boolean;})=>string;
11
+ trim?:boolean;};
30
12
  /** ----------------------------------------------------------
31
- * * ***Capitalizes the first letter of each word in a string
32
- * while converting the rest to lowercase.***
13
+ * * ***Utility: `capitalizeFirst`.***
33
14
  * ----------------------------------------------------------
15
+ * **Capitalizes the first letter of a string, with optionally lowercases the rest and trims whitespace.**
16
+ * @param {string | null | undefined} string - The string to be processed.
17
+ * @param {CapitalizeFirstOptions} [options] - Options to control behavior.
18
+ * @param {CapitalizeFirstOptions["lowerCaseNextRest"]} [options.lowerCaseNextRest=true] - If true, lowercases the rest (next first letter), default: `true`.
19
+ * @param {CapitalizeFirstOptions["trim"]} [options.trim=false] - If true, trims the string before processing, default: `false`.
20
+ * @returns {string} The processed string, returns `""` if input is `null`, `undefined`, or `not a valid string`.
21
+ * @example
22
+ * ```ts
23
+ * capitalizeFirst(" hello WORLD ")
24
+ * // ➔ " Hello world"
25
+ * capitalizeFirst(" hello WORLD ", { trim: true })
26
+ * // ➔ "Hello world"
27
+ * capitalizeFirst("FOO", { lowerCaseNextRest: false })
28
+ * // ➔ "FOO"
29
+ * capitalizeFirst(" foo BAR ", { trim: true, lowerCaseNextRest: false })
30
+ * // ➔ "Foo BAR"
31
+ * ```
32
+ * #### ℹ️ If null, undefined, or not a valid string input, return `""`.
33
+ * ```ts
34
+ * capitalizeFirst(123)
35
+ * capitalizeFirst(null)
36
+ * capitalizeFirst(undefined)
37
+ * // ➔ ""
38
+ * ```
39
+ */
40
+ declare const capitalizeFirst:(string:string|null|undefined,options?:CapitalizeFirstOptions)=>string;type CapitalizeWordsOptions={
41
+ /** If `true`, removes leading and trailing spaces, default `false`.
42
+ *
43
+ * @default false
44
+ */
45
+ trim?:boolean;
46
+ /** If `true`, collapses multiple spaces **between words** into a single space (while preserving leading/trailing spaces), default `false`.
34
47
  *
35
- * @param value - The input string to be processed. If `null` or `undefined`, returns an empty string.
36
- * @param options - Optional settings to control the output:
48
+ * @default false
49
+ */
50
+ collapseSpaces?:boolean;};
51
+ /** ----------------------------------------------------------
52
+ * * ***Utility: `capitalizeWords`.***
53
+ * ----------------------------------------------------------
54
+ * **Capitalizes the first letter of each word in a string while converting the rest to lowercase.**
55
+ * @param {string | null | undefined} value
56
+ * The input string to be processed.
57
+ * - If `null` or `undefined`, returns an empty-string (`""`).
58
+ * @param {CapitalizeWordsOptions} [options]
59
+ * Optional settings to control the output:
37
60
  * - `trim`: If `true`, removes leading and trailing spaces, defaultValue: `false`.
38
61
  * - `collapseSpaces`: If `true`, collapses multiple spaces **between words** into a single space (while preserving leading/trailing spaces), defaultValue: `false`.
39
- *
40
- * @returns A new string where each word starts with an uppercase letter
41
- * and the remaining letters are lowercase. If `value` is empty, `null`, or `undefined`,
42
- * returns an empty string.
43
- *
62
+ * @returns {string} A new string where each word starts with an uppercase letter
63
+ * and the remaining letters are lowercase.
64
+ * - If `value` is `empty`, `null`, or `undefined`, returns an `empty-string`.
44
65
  * @example
66
+ * ```ts
45
67
  * capitalizeWords(" hello world ");
46
- * // => " Hello World "
47
- *
68
+ * // " Hello World "
48
69
  * capitalizeWords(" hello world ", { trim: true });
49
- * // => "Hello World"
50
- *
70
+ * // "Hello World"
51
71
  * capitalizeWords(" hello world ", { collapseSpaces: true });
52
- * // => " Hello World "
53
- *
72
+ * // " Hello World "
54
73
  * capitalizeWords(" hello world ", { trim: true, collapseSpaces: true });
55
- * // => "Hello World"
74
+ * // "Hello World"
75
+ * ```
76
+ * #### ℹ️ If null, undefined, or not a valid string input, return "".
77
+ * ```ts
78
+ * capitalizeWords(123);
79
+ * capitalizeWords(null);
80
+ * capitalizeWords(undefined);
81
+ * // ➔ ""
82
+ * ```
56
83
  */
57
- declare const capitalizeWords:(value?:string|null,options?:{
58
- /** If `true`, removes leading and trailing spaces, default `false`. */
59
- trim?:boolean;
60
- /** If `true`, collapses multiple spaces **between words** into a single space (while preserving leading/trailing spaces), default `false`. */
61
- collapseSpaces?:boolean;})=>string;
84
+ declare const capitalizeWords:(value:string|null|undefined,options?:CapitalizeWordsOptions)=>string;
62
85
  /** --------------------------------------------------
63
- * * ***Represents a string input that may be:***
64
- * - a single string,
65
- * - an array of strings,
66
- * - a readonly array of strings,
67
- * - or `null` / `undefined`.
86
+ * * ***Represents a string input.***
68
87
  * --------------------------------------------------
69
88
  *
70
- * @template T A string or array of strings.
89
+ * - **Can be one of:**
90
+ * - A single `string`
91
+ * - An array of strings (`string[]`)
92
+ * - A readonly array of strings (`readonly string[]`)
93
+ * - `null` or `undefined`
94
+ *
95
+ * @template T - A string or array of strings.
71
96
  */
72
97
  type StringLike=Nilable<string|string[]|ReadonlyArray<string>>;
73
98
  /** --------------------------------------------------
74
- * * ***Represents a collection of strings, which can be:***
75
- * - a single string,
76
- * - an array of strings,
77
- * - a readonly array of strings,
78
- * - a `Set` of strings, or
79
- * - a `ReadonlySet` of strings.
99
+ * * ***Represents a collection of strings.***
80
100
  * --------------------------------------------------
101
+ *
102
+ * - **Can be one of:**
103
+ * - A single `string`
104
+ * - An array of strings (`string[]`)
105
+ * - A readonly array of strings (`readonly string[]`)
106
+ * - A `Set<string>`
107
+ * - A `ReadonlySet<string>`
81
108
  */
82
109
  type StringCollection=string|string[]|ReadonlyArray<string>|Set<string>|ReadonlySet<string>;
83
110
  /** ----------------------------------------------------------
84
- * * ***Converts a string (or array of strings) into `camelCase`, with optionally leaving specific words unchanged.***
111
+ * * ***Utility: `toCamelCase`.***
85
112
  * ----------------------------------------------------------
86
- *
87
- * @description
88
- * - Accepts a `string` or an array of `strings`:
89
- * - If an array is provided, elements are trimmed, empty ones removed,
90
- * then joined with `"-"` before conversion.
91
- * - Splits the input by non-alphanumeric characters
92
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
93
- * - The first word is fully lowercase; subsequent words are capitalized.
94
- * - Words listed in `ignoreWord` remain unchanged in the output.
95
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
96
- * - `ignoreWord` accepts:
97
- * - a single string,
98
- * - an array of strings, or
99
- * - a `Set` of strings.
100
- * - Multiple delimiters collapse into one; empty segments ignored.
101
- * - Returns `""` if the input is `null`, `undefined`, or empty.
102
- *
113
+ * **Converts a string (or array of strings) into `camelCase`, with optionally leaving specific words unchanged.**
114
+ * - **Behavior:**
115
+ * - Accepts a `string` or an `array of strings`:
116
+ * - If an array is provided, elements are trimmed, empty ones removed,
117
+ * then joined with `"-"` before conversion.
118
+ * - Splits the input by non-alphanumeric characters
119
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
120
+ * - The first word is fully lowercase; subsequent words are capitalized.
121
+ * - Words listed in `ignoreWord` remain unchanged in the output.
122
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
123
+ * - `ignoreWord` accepts:
124
+ * - a single string,
125
+ * - an array of strings, or
126
+ * - a `Set` of strings.
127
+ * - Multiple delimiters collapse into one; empty segments ignored.
128
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
103
129
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
104
130
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
105
131
  * @returns {string} The camelCase formatted string.
106
- *
107
132
  * @example
108
133
  * // Basic usage
109
134
  * toCamelCase("hello world");
110
135
  * // ➔ "helloWorld"
111
136
  *
112
- * @example
113
137
  * // Array input is joined before conversion
114
138
  * toCamelCase(["Join", "Words", "Here"]);
115
139
  * // ➔ "joinWordsHere"
116
140
  *
117
- * @example
118
141
  * // Supports mixed delimiters
119
142
  * toCamelCase("convert_to-camel case");
120
143
  * // ➔ "convertToCamelCase"
121
144
  *
122
- * @example
123
145
  * // Words in ignoreWord stay unchanged
124
146
  * toCamelCase("this URL path will ignore", "URL");
125
147
  * // ➔ "thisURLPathWillIgnore"
126
148
  *
127
- * @example
128
149
  * // Multiple ignored words
129
150
  * toCamelCase("ignore API and URL", ["API", "URL"]);
130
151
  * // ➔ "ignoreAPIAndURL"
131
152
  *
132
- * @example
133
153
  * // Set can also be used
134
154
  * toCamelCase("ignore API and URL", new Set(["API", "URL"]));
135
155
  * // ➔ "ignoreAPIAndURL"
136
156
  *
137
- * @example
138
- * // Null or empty input returns empty string
157
+ * // Null, Undefined or empty (string or array) input returns empty string
139
158
  * toCamelCase(null);
140
159
  * // ➔ ""
141
160
  */
142
161
  declare const toCamelCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
143
162
  /** ----------------------------------------------------------
144
- * * ***Converts a string (or array of strings) into `PascalCaseSpace`, with optionally leaving specific words unchanged.***
163
+ * * ***Utility: `toPascalCaseSpace`.***
145
164
  * ----------------------------------------------------------
146
- *
147
- * @description
148
- * - Accepts a `string` or an array of `strings`:
149
- * - If an array is provided, elements are trimmed, empty ones removed,
150
- * then joined with `"-"` before conversion.
151
- * - Splits the input by non-alphanumeric characters
152
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
153
- * - The first word is fully lowercase; subsequent words are capitalized.
154
- * - Words listed in `ignoreWord` remain unchanged in the output.
155
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
156
- * - `ignoreWord` accepts:
157
- * - a single string,
158
- * - an array of strings, or
159
- * - a `Set` of strings.
160
- * - Multiple delimiters collapse into one; empty segments ignored.
161
- * - Returns `""` if the input is `null`, `undefined`, or empty.
162
- *
165
+ * **Converts a string (or array of strings) into `PascalCaseSpace`, with optionally leaving specific words unchanged.**
166
+ * - **Behavior:**
167
+ * - Accepts a `string` or an `array of strings`:
168
+ * - If an array is provided, elements are trimmed, empty ones removed,
169
+ * then joined with `"-"` before conversion.
170
+ * - Splits the input by non-alphanumeric characters
171
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
172
+ * - The first word is fully lowercase; subsequent words are capitalized.
173
+ * - Words listed in `ignoreWord` remain unchanged in the output.
174
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
175
+ * - `ignoreWord` accepts:
176
+ * - a single string,
177
+ * - an array of strings, or
178
+ * - a `Set` of strings.
179
+ * - Multiple delimiters collapse into one; empty segments ignored.
180
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
163
181
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
164
182
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
165
183
  * @returns {string} The PascalCaseSpace formatted string.
166
- *
167
184
  * @example
168
185
  * // Basic usage
169
186
  * toPascalCaseSpace("hello world");
170
187
  * // ➔ "Hello World"
171
188
  *
172
- * @example
173
189
  * // Array input is joined before conversion
174
190
  * toPascalCaseSpace(["Join", "Words", "Here"]);
175
191
  * // ➔ "Join Words Here"
176
192
  *
177
- * @example
178
193
  * // Handles underscores and hyphens
179
194
  * toPascalCaseSpace("convert_to-pascal case");
180
195
  * // ➔ "Convert To Pascal Case Space"
181
196
  *
182
- * @example
183
197
  * // Trims extra delimiters
184
198
  * toPascalCaseSpace("___hello--world__ again!!");
185
199
  * // ➔ "Hello World Again"
186
200
  *
187
- * @example
188
201
  * // Supports emojis and symbols
189
202
  * toPascalCaseSpace("🔥fire_and-ice❄️");
190
203
  * // ➔ "Fire And Ice"
191
204
  *
192
- * @example
193
205
  * // Ignore single word
194
206
  * toPascalCaseSpace("this URL path will ignore", "URL");
195
207
  * // ➔ "This URL Path Will Ignore"
196
208
  *
197
- * @example
198
209
  * // Ignore multiple words
199
210
  * toPascalCaseSpace("ignore API and URL", ["API", "URL"]);
200
211
  * // ➔ "Ignore API And URL"
201
212
  *
202
- * @example
203
213
  * // Ignore using Set
204
214
  * toPascalCaseSpace("ignore API and URL", new Set(["API", "URL"]));
205
215
  * // ➔ "Ignore API And URL"
206
216
  *
207
- * @example
208
- * // Null or empty returns empty string
217
+ * // Null, Undefined or empty (string or array) input returns empty string
209
218
  * toPascalCaseSpace(undefined);
210
219
  * // ➔ ""
211
220
  */
212
221
  declare const toPascalCaseSpace:(input:StringLike,ignoreWord?:StringCollection)=>string;
213
222
  /** ----------------------------------------------------------
214
- * * ***Converts a string (or array of strings) into `PascalCase`, with optionally leaving specific words unchanged.***
223
+ * * ***Utility: `toPascalCase`.***
215
224
  * ----------------------------------------------------------
216
- *
217
- * @description
218
- * - Accepts a `string` or an array of `strings`:
219
- * - If an array is provided, elements are trimmed, empty ones removed,
220
- * then joined with `"-"` before conversion.
221
- * - Splits the input by non-alphanumeric characters
222
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
223
- * - The first word is fully lowercase; subsequent words are capitalized.
224
- * - Words listed in `ignoreWord` remain unchanged in the output.
225
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
226
- * - `ignoreWord` accepts:
227
- * - a single string,
228
- * - an array of strings, or
229
- * - a `Set` of strings.
230
- * - Multiple delimiters collapse into one; empty segments ignored.
231
- * - Returns `""` if the input is `null`, `undefined`, or empty.
232
- *
225
+ * **Converts a string (or array of strings) into `PascalCase`, with optionally leaving specific words unchanged.**
226
+ * - **Behavior:**
227
+ * - Accepts a `string` or an `array of strings`:
228
+ * - If an array is provided, elements are trimmed, empty ones removed,
229
+ * then joined with `"-"` before conversion.
230
+ * - Splits the input by non-alphanumeric characters
231
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
232
+ * - The first word is fully lowercase; subsequent words are capitalized.
233
+ * - Words listed in `ignoreWord` remain unchanged in the output.
234
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
235
+ * - `ignoreWord` accepts:
236
+ * - a single string,
237
+ * - an array of strings, or
238
+ * - a `Set` of strings.
239
+ * - Multiple delimiters collapse into one; empty segments ignored.
240
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
233
241
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
234
242
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
235
243
  * @returns {string} The PascalCase formatted string.
236
- *
237
244
  * @example
238
245
  * // Basic usage
239
246
  * toPascalCase("hello world");
240
247
  * // ➔ "HelloWorld"
241
248
  *
242
- * @example
243
249
  * // Array input is joined before conversion
244
250
  * toPascalCase(["Join", "Words", "Here"]);
245
251
  * // ➔ "JoinWordsHere"
246
252
  *
247
- * @example
248
253
  * // Handles underscores and hyphens
249
254
  * toPascalCase("convert_to-pascal case");
250
255
  * // ➔ "ConvertToPascalCase"
251
256
  *
252
- * @example
253
257
  * // Trims extra delimiters
254
258
  * toPascalCase("___hello--world__ again!!");
255
259
  * // ➔ "HelloWorldAgain"
256
260
  *
257
- * @example
258
261
  * // Supports emojis and symbols
259
262
  * toPascalCase("🔥fire_and-ice❄️");
260
263
  * // ➔ "FireAndIce"
261
264
  *
262
- * @example
263
265
  * // Ignore single word
264
266
  * toPascalCase("this URL path will ignore", "URL");
265
267
  * // ➔ "ThisURLPathWillIgnore"
266
268
  *
267
- * @example
268
269
  * // Ignore multiple words
269
270
  * toPascalCase("ignore API and URL", ["API", "URL"]);
270
271
  * // ➔ "IgnoreAPIAndURL"
271
272
  *
272
- * @example
273
273
  * // Ignore using Set
274
274
  * toPascalCase("ignore API and URL", new Set(["API", "URL"]));
275
275
  * // ➔ "IgnoreAPIAndURL"
276
276
  *
277
- * @example
278
- * // Null or empty returns empty string
277
+ * // Null, Undefined or empty (string or array) input returns empty string
279
278
  * toPascalCase(undefined);
280
279
  * // ➔ ""
281
280
  */
282
281
  declare const toPascalCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
283
282
  /** ----------------------------------------------------------
284
- * * ***Converts a string (or array of strings) into `LowerCase`, with optionally leaving specific words unchanged.***
283
+ * * ***Utility: `toLowerCase`.***
285
284
  * ----------------------------------------------------------
286
- *
287
- * @description
288
- * - Accepts a `string` or an array of `strings`:
289
- * - If an array is provided, elements are trimmed, empty ones removed,
290
- * then joined with `"-"` before conversion.
291
- * - Splits the input by non-alphanumeric characters
292
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
293
- * - The first word is fully lowercase; subsequent words are capitalized.
294
- * - Words listed in `ignoreWord` remain unchanged in the output.
295
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
296
- * - `ignoreWord` accepts:
297
- * - a single string,
298
- * - an array of strings, or
299
- * - a `Set` of strings.
300
- * - Multiple delimiters collapse into one; empty segments ignored.
301
- * - Returns `""` if the input is `null`, `undefined`, or empty.
302
- *
285
+ * **Converts a string (or array of strings) into `lower case`, with optionally leaving specific words unchanged.**
286
+ * - **Behavior:**
287
+ * - Accepts a `string` or an `array of strings`:
288
+ * - If an array is provided, elements are trimmed, empty ones removed,
289
+ * then joined with `"-"` before conversion.
290
+ * - Splits the input by non-alphanumeric characters
291
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
292
+ * - The first word is fully lowercase; subsequent words are capitalized.
293
+ * - Words listed in `ignoreWord` remain unchanged in the output.
294
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
295
+ * - `ignoreWord` accepts:
296
+ * - a single string,
297
+ * - an array of strings, or
298
+ * - a `Set` of strings.
299
+ * - Multiple delimiters collapse into one; empty segments ignored.
300
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
303
301
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
304
302
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
305
303
  * @returns {string} The LowerCase formatted string.
306
- *
307
304
  * @example
308
305
  * // Basic usage
309
306
  * toLowerCase("Hello World");
310
307
  * // ➔ "hello world"
311
308
  *
312
- * @example
313
309
  * // Array input is joined before conversion
314
310
  * toLowerCase(["Join", "WORLD", "Here"]);
315
311
  * // ➔ "join words here"
316
312
  *
317
- * @example
318
313
  * // Handles underscores and hyphens
319
314
  * toLowerCase("convert_to-pascal case");
320
315
  * // ➔ "convert to lower case"
321
316
  *
322
- * @example
323
317
  * // Trims extra delimiters
324
318
  * toLowerCase("___hello--world__ again!!");
325
319
  * // ➔ "hello world again"
326
320
  *
327
- * @example
328
321
  * // Supports emojis and symbols
329
322
  * toLowerCase("🔥fire_and-ice❄️");
330
323
  * // ➔ "fire and ice"
331
324
  *
332
- * @example
333
325
  * // Ignore single word
334
326
  * toLowerCase("this URL path will ignore", "URL");
335
327
  * // ➔ "this URL path will ignore"
336
328
  *
337
- * @example
338
329
  * // Ignore multiple words
339
330
  * toLowerCase("ignore API and URL", ["API", "URL"]);
340
331
  * // ➔ "ignore API and URL"
341
332
  *
342
- * @example
343
333
  * // Ignore using Set
344
334
  * toLowerCase("ignore API and URL", new Set(["API", "URL"]));
345
335
  * // ➔ "ignore API and URL"
346
336
  *
347
- * @example
348
- * // Null or empty returns empty string
337
+ * // Null, Undefined or empty (string or array) input returns empty string
349
338
  * toLowerCase(undefined);
350
339
  * // ➔ ""
351
340
  */
352
341
  declare const toLowerCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
353
342
  /** ----------------------------------------------------------
354
- * * ***Converts a string (or array of strings) into `kebab-case`, with optionally leaving specific words unchanged.***
343
+ * * ***Utility: `toKebabCase`.***
355
344
  * ----------------------------------------------------------
356
- *
357
- * @description
358
- * - Accepts a `string` or an array of `strings`:
359
- * - If an array is provided, elements are trimmed, empty ones removed,
360
- * then joined with `"-"` before conversion.
361
- * - Splits the input by non-alphanumeric characters
362
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
363
- * - The first word is fully lowercase; subsequent words are capitalized.
364
- * - Words listed in `ignoreWord` remain unchanged in the output.
365
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
366
- * - `ignoreWord` accepts:
367
- * - a single string,
368
- * - an array of strings, or
369
- * - a `Set` of strings.
370
- * - Multiple delimiters collapse into one; empty segments ignored.
371
- * - Returns `""` if the input is `null`, `undefined`, or empty.
372
- *
345
+ * **Converts a string (or array of strings) into `kebab-case`, with optionally leaving specific words unchanged.**
346
+ * - **Behavior:**
347
+ * - Accepts a `string` or an `array of strings`:
348
+ * - If an array is provided, elements are trimmed, empty ones removed,
349
+ * then joined with `"-"` before conversion.
350
+ * - Splits the input by non-alphanumeric characters
351
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
352
+ * - The first word is fully lowercase; subsequent words are capitalized.
353
+ * - Words listed in `ignoreWord` remain unchanged in the output.
354
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
355
+ * - `ignoreWord` accepts:
356
+ * - a single string,
357
+ * - an array of strings, or
358
+ * - a `Set` of strings.
359
+ * - Multiple delimiters collapse into one; empty segments ignored.
360
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
373
361
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
374
362
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
375
363
  * @returns {string} The kebab-case formatted string.
376
- *
377
364
  * @example
378
365
  * // Basic usage
379
366
  * toKebabCase("Hello World");
380
367
  * // ➔ "hello-world"
381
368
  *
382
- * @example
383
369
  * // Array input is joined before conversion
384
370
  * toKebabCase(["Join", "Words", "Here"]);
385
371
  * // ➔ "join-words-here"
386
372
  *
387
- * @example
388
373
  * // Handles underscores and hyphens
389
374
  * toKebabCase("convert_to-kebab case");
390
375
  * // ➔ "convert-to-kebab-case"
391
376
  *
392
- * @example
393
377
  * // Handles emojis and symbols
394
378
  * toKebabCase("🔥fire___and--ice❄️");
395
379
  * // ➔ "fire-and-ice"
396
380
  *
397
- * @example
398
381
  * // Ignore specific word
399
382
  * toKebabCase("ignore URL case", "URL");
400
383
  * // ➔ "ignore-URL-case"
401
384
  *
402
- * @example
403
385
  * // Ignore multiple words
404
386
  * toKebabCase("ignore API and URL", ["API", "URL"]);
405
387
  * // ➔ "ignore-API-and-URL"
406
388
  *
407
- * @example
408
389
  * // Ignore with Set
409
390
  * toKebabCase("ignore API and URL", new Set(["API", "URL"]));
410
391
  * // ➔ "ignore-API-and-URL"
411
392
  *
412
- * @example
413
- * // Null or empty input
393
+ * // Null, Undefined or empty (string or array) input returns empty string
414
394
  * toKebabCase(null);
415
395
  * // ➔ ""
416
396
  */
417
397
  declare const toKebabCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
418
398
  /** ----------------------------------------------------------
419
- * * ***Converts a string (or array of strings) into `snake_case`, with optionally leaving specific words unchanged.***
399
+ * * ***Utility: `toSnakeCase`.***
420
400
  * ----------------------------------------------------------
421
- *
422
- * @description
423
- * - Accepts a `string` or an array of `strings`:
424
- * - If an array is provided, elements are trimmed, empty ones removed,
425
- * then joined with `"-"` before conversion.
426
- * - Splits the input by non-alphanumeric characters
427
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
428
- * - The first word is fully lowercase; subsequent words are capitalized.
429
- * - Words listed in `ignoreWord` remain unchanged in the output.
430
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
431
- * - `ignoreWord` accepts:
432
- * - a single string,
433
- * - an array of strings, or
434
- * - a `Set` of strings.
435
- * - Multiple delimiters collapse into one; empty segments ignored.
436
- * - Returns `""` if the input is `null`, `undefined`, or empty.
437
- *
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.
438
417
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
439
418
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
440
419
  * @returns {string} The snake_case formatted string.
441
- *
442
420
  * @example
443
421
  * // Basic usage
444
422
  * toSnakeCase("Hello World");
445
423
  * // ➔ "hello_world"
446
424
  *
447
- * @example
448
425
  * // Array input is joined before conversion
449
426
  * toSnakeCase(["Join", "Words", "Here"]);
450
427
  * // ➔ "join_words_here"
451
428
  *
452
- * @example
453
429
  * // Handles underscores, hyphens, spaces
454
430
  * toSnakeCase("convert-to_snake case");
455
431
  * // ➔ "convert_to_snake_case"
456
432
  *
457
- * @example
458
433
  * // Handles emojis and symbols
459
434
  * toSnakeCase("🔥fire___and--ice❄️");
460
435
  * // ➔ "fire_and_ice"
461
436
  *
462
- * @example
463
437
  * // Ignore specific word
464
438
  * toSnakeCase("ignore URL case", "URL");
465
439
  * // ➔ "ignore_URL_case"
466
440
  *
467
- * @example
468
441
  * // Ignore multiple words
469
442
  * toSnakeCase("ignore API and URL", ["API", "URL"]);
470
443
  * // ➔ "ignore_API_and_URL"
471
444
  *
472
- * @example
473
445
  * // Ignore with Set
474
446
  * toSnakeCase("ignore API and URL", new Set(["API", "URL"]));
475
447
  * // ➔ "ignore_API_and_URL"
476
448
  *
477
- * @example
478
- * // Null or empty input
449
+ * // Null, Undefined or empty (string or array) input returns empty string
479
450
  * toSnakeCase(null);
480
451
  * // ➔ ""
481
452
  */
482
453
  declare const toSnakeCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
483
454
  /** ----------------------------------------------------------
484
- * * ***Converts a string (or array of strings) into `dot.case`, with optionally leaving specific words unchanged.***
455
+ * * ***Utility: `toDotCase`.***
485
456
  * ----------------------------------------------------------
486
- *
487
- * @description
488
- * - Accepts a `string` or an array of `strings`:
489
- * - If an array is provided, elements are trimmed, empty ones removed,
490
- * then joined with `"-"` before conversion.
491
- * - Splits the input by non-alphanumeric characters
492
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
493
- * - The first word is fully lowercase; subsequent words are capitalized.
494
- * - Words listed in `ignoreWord` remain unchanged in the output.
495
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
496
- * - `ignoreWord` accepts:
497
- * - a single string,
498
- * - an array of strings, or
499
- * - a `Set` of strings.
500
- * - Multiple delimiters collapse into one; empty segments ignored.
501
- * - Returns `""` if the input is `null`, `undefined`, or empty.
502
- *
457
+ * **Converts a string (or array of strings) into `dot.case`, with optionally leaving specific words unchanged.**
458
+ * - **Behavior:**
459
+ * - Accepts a `string` or an `array of strings`:
460
+ * - If an array is provided, elements are trimmed, empty ones removed,
461
+ * then joined with `"-"` before conversion.
462
+ * - Splits the input by non-alphanumeric characters
463
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
464
+ * - The first word is fully lowercase; subsequent words are capitalized.
465
+ * - Words listed in `ignoreWord` remain unchanged in the output.
466
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
467
+ * - `ignoreWord` accepts:
468
+ * - a single string,
469
+ * - an array of strings, or
470
+ * - a `Set` of strings.
471
+ * - Multiple delimiters collapse into one; empty segments ignored.
472
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
503
473
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
504
474
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
505
475
  * @returns {string} The dot.case formatted string.
506
- *
507
476
  * @example
508
477
  * // Basic usage
509
478
  * toDotCase("Hello World");
510
479
  * // ➔ "hello.world"
511
480
  *
512
- * @example
513
481
  * // Array input is joined before conversion
514
482
  * toDotCase(["Join", "Words", "Here"]);
515
483
  * // ➔ "join.words.here"
516
484
  *
517
- * @example
518
485
  * // Handles underscores and hyphens
519
486
  * toDotCase("convert-to_dot case");
520
487
  * // ➔ "convert.to.dot.case"
521
488
  *
522
- * @example
523
489
  * // Multiple delimiters and trimming
524
490
  * toDotCase("___Hello--World__ again!!");
525
491
  * // ➔ "hello.world.again"
526
492
  *
527
- * @example
528
493
  * // Supports emojis and symbols
529
494
  * toDotCase("🔥Fire_and-ice❄️");
530
495
  * // ➔ "fire.and.ice"
531
496
  *
532
- * @example
533
497
  * // Ignore single word
534
498
  * toDotCase("this URL path", "URL");
535
499
  * // ➔ "this.URL.path"
536
500
  *
537
- * @example
538
501
  * // Ignore multiple words
539
502
  * toDotCase("ignore API and URL", ["API", "URL"]);
540
503
  * // ➔ "ignore.API.and.URL"
541
504
  *
542
- * @example
543
505
  * // Ignore using Set
544
506
  * toDotCase("ignore API and URL", new Set(["API", "URL"]));
545
507
  * // ➔ "ignore.API.and.URL"
546
508
  *
547
- * @example
548
- * // Null or empty returns empty string
509
+ * // Null, Undefined or empty (string or array) input returns empty string
549
510
  * toDotCase(undefined);
550
511
  * // ➔ ""
551
512
  */
552
513
  declare const toDotCase:(input:StringLike,ignoreWord?:StringCollection)=>string;
553
514
  /** ----------------------------------------------------------
554
- * * ***Slugifies a string (or array of strings) for safe use in URLs, with optionally leaving specific words unchanged.***
515
+ * * ***Utility: `slugify`.***
555
516
  * ----------------------------------------------------------
556
- *
557
- * @description
558
- * - Accepts a `string` or an array of `strings`:
559
- * - If an array is provided, elements are trimmed, empty ones removed,
560
- * then joined with `"-"` before conversion.
561
- * - Splits the input by non-alphanumeric characters
562
- * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
563
- * - The first word is fully lowercase; subsequent words are capitalized.
564
- * - Words listed in `ignoreWord` remain unchanged in the output.
565
- * - `ignoreWord` is normalized (trimmed, delimiters removed); empty values ignored.
566
- * - `ignoreWord` accepts:
567
- * - a single string,
568
- * - an array of strings, or
569
- * - a `Set` of strings.
570
- * - Multiple delimiters collapse into one; empty segments ignored.
571
- * - Returns `""` if the input is `null`, `undefined`, or empty.
572
- *
517
+ * **Slugifies a string (or array of strings) for safe use in URLs, with optionally leaving specific words unchanged.**
518
+ * - **Behavior:**
519
+ * - Accepts a `string` or an `array of strings`:
520
+ * - If an array is provided, elements are trimmed, empty ones removed,
521
+ * then joined with `"-"` before conversion.
522
+ * - Splits the input by non-alphanumeric characters
523
+ * (spaces, punctuation, symbols, hyphens, underscores, emojis, etc.).
524
+ * - The first word is fully lowercase; subsequent words are capitalized.
525
+ * - Words listed in `ignoreWord` remain unchanged in the output.
526
+ * - `ignoreWord` is normalized (trimmed, delimiters removed), empty values ignored.
527
+ * - `ignoreWord` accepts:
528
+ * - a single string,
529
+ * - an array of strings, or
530
+ * - a `Set` of strings.
531
+ * - Multiple delimiters collapse into one; empty segments ignored.
532
+ * - Returns `""` if the input is `null`, `undefined`, or empty.
573
533
  * @param {StringLike} input - The string or array to convert. Returns `""` if empty, `null`, or `undefined`.
574
534
  * @param {StringCollection} [ignoreWord] - Optional word(s) to leave unchanged in the output.
575
535
  * @returns {string} The slugified string.
576
- *
577
536
  * @example
578
537
  * // Basic usage
579
538
  * slugify("Hello World!");
580
539
  * // ➔ "hello-world"
581
540
  *
582
- * @example
583
541
  * // Array input is joined before conversion
584
542
  * slugify(["Join", "Words", "Here"]);
585
543
  * // ➔ "join-words-here"
586
544
  *
587
- * @example
588
545
  * // Trims and cleans input
589
546
  * slugify(" --- Convert to Slug? --- ");
590
547
  * // ➔ "convert-to-slug"
591
548
  *
592
- * @example
593
549
  * // Ignore single word
594
550
  * slugify("This URL path", "URL");
595
551
  * // ➔ "this-URL-path"
596
552
  *
597
- * @example
598
553
  * // Ignore multiple words
599
554
  * slugify("ignore API and URL", ["API", "URL"]);
600
555
  * // ➔ "ignore-API-and-URL"
601
556
  *
602
- * @example
603
557
  * // Ignore using Set
604
558
  * slugify("ignore API and URL", new Set(["API", "URL"]));
605
559
  * // ➔ "ignore-API-and-URL"
606
560
  *
607
- * @example
608
561
  * // Supports emojis and symbols
609
562
  * slugify("🔥 Fire_and_ice ❄️");
610
563
  * // ➔ "fire-and-ice"
611
564
  *
612
- * @example
613
- * // Null or empty returns empty string
565
+ * // Null, Undefined or empty (string or array) input returns empty string
614
566
  * slugify(undefined);
615
567
  * // ➔ ""
616
568
  */
617
- declare const slugify:(input:StringLike,ignoreWord?:StringCollection)=>string;
618
- /** ----------------------------------------------------------
619
- * * ***Normalizes whitespace in a string by reducing multiple spaces
620
- * to a single space, optionally trims, or only trims based on options.***
621
- * ----------------------------------------------------------
622
- *
623
- * - ✅ Collapses all consecutive whitespace (spaces, tabs, newlines) into a single space.
624
- * - ✅ Can trim leading/trailing spaces (default behavior), or preserve them with `withTrim: false`.
625
- * - ✅ Can skip normalization entirely and only trim using `trimOnly: true`.
626
- * - ✅ Returns an empty string if input is `null` or `undefined`.
569
+ declare const slugify:(input:StringLike,ignoreWord?:StringCollection)=>string;type NormalizeSpacesOptions={
570
+ /** If `true`, skips normalization and only trims whitespace from start & end, defaultValue: `false`.
627
571
  *
628
- * @param {string} [value] - The input string to be processed. If `null` or `undefined`, returns an empty string.
629
- * @param {object} [options] - Configuration options.
630
- * @param {boolean} [options.trimOnly=false] - If `true`, skips normalization and only trims the string.
631
- * @param {boolean} [options.withTrim=true] - If `false`, preserves leading/trailing whitespace.
572
+ * @default false
573
+ */
574
+ trimOnly?:boolean;
575
+ /** If `false`, skips trimming value, defaultValue: `true`.
632
576
  *
577
+ * @default true
578
+ */
579
+ withTrim?:boolean;};
580
+ /** ----------------------------------------------------------
581
+ * * ***Utility: `normalizeSpaces`.***
582
+ * ----------------------------------------------------------
583
+ * **Normalizes whitespace in a string by reducing multiple spaces
584
+ * to a single space, optionally trims, or only trims based on options.**
585
+ * - **Behavior:**
586
+ * - Collapses all consecutive whitespace (spaces, tabs, newlines) into a single space.
587
+ * - Can trim leading/trailing spaces (default behavior), or preserve them with `withTrim: false`.
588
+ * - Can skip normalization entirely and only trim using `trimOnly: true`.
589
+ * - Returns an empty string if input is `null` or `undefined`.
590
+ * @param {string | null | undefined} value - The input string to be processed. If `null` or `undefined`, returns an empty string.
591
+ * @param {NormalizeSpacesOptions} [options] - Configuration options.
592
+ * @param {NormalizeSpacesOptions["trimOnly"]} [options.trimOnly=false] - If `true`, skips normalization and only trims the string.
593
+ * @param {NormalizeSpacesOptions["withTrim"]} [options.withTrim=true] - If `false`, preserves leading/trailing whitespace.
633
594
  * @returns {string} The processed string.
634
- *
635
595
  * @example
636
596
  * normalizeSpaces(" Hello World\tthis is\n\nok ");
637
597
  * // ➔ "Hello World this is ok"
638
- *
639
598
  * normalizeSpaces(" Hello World\tthis is\n\nok ", { trimOnly: true });
640
599
  * // ➔ "Hello World this is\n\nok"
641
- *
642
600
  * normalizeSpaces(" Hello World ", { withTrim: false });
643
601
  * // ➔ " Hello World "
644
- *
645
602
  * normalizeSpaces(null);
646
603
  * // ➔ ""
647
604
  */
648
- declare const normalizeSpaces:(value?:string|null,options?:{
649
- /**
650
- * If `true`, skips normalization and only trims whitespace from start & end.
651
- * @default false */
652
- trimOnly?:boolean;
653
- /**
654
- * If `false`, skips trimming value.
655
- * @default true */
656
- withTrim?:boolean;})=>string;
605
+ declare const normalizeSpaces:(value:string|null|undefined,options?:NormalizeSpacesOptions)=>string;
657
606
  /** ----------------------------------------------------------
658
- * * ***Normalizes a string by ensuring it is a valid string and trimming whitespace.***
607
+ * * ***Utility: `normalizeString`.***
659
608
  * ----------------------------------------------------------
660
- *
661
- * @description
662
- * If the input is `undefined`, `null`, or an `empty string` after trimming,
663
- * it returns an empty string `("")`.
664
- *
609
+ * **Normalizes a string by ensuring it is a valid string and trimming whitespace.**
610
+ * - **Behavior:**
611
+ * - If the input is `undefined`, `null`, or an `empty string` after trimming,
612
+ * it returns an empty string `("")`.
665
613
  * @param {string | undefined | null} input - The input string to be normalize. If `null` or `undefined`, returns an empty string.
666
614
  * @returns {string} A trimmed string or an empty string if the input is invalid.
667
- *
668
615
  * @example
669
616
  * normalizeString(" Hello World ");
670
617
  * // ➔ "Hello World"
@@ -677,53 +624,44 @@ withTrim?:boolean;})=>string;
677
624
  * normalizeString(undefined);
678
625
  * // ➔ ""
679
626
  */
680
- declare const normalizeString:(input?:string|null)=>string;
627
+ declare const normalizeString:(input:string|null|undefined)=>string;type RemoveSpacesOptions={
628
+ /** If `true`, only trims the string, defaultValue: `false`.
629
+ *
630
+ * @default false */
631
+ trimOnly?:boolean;};
681
632
  /** ----------------------------------------------------------
682
- * * ***Removes all spaces from a string or trims only, based on the options provided.***
633
+ * * ***Utility: `removeSpaces`.***
683
634
  * ----------------------------------------------------------
684
- *
685
- * @description
686
- * - If `trimOnly` is `true`, the string is simply trimmed.
687
- * - Otherwise, removes **all spaces**, tabs, newlines, etc.
688
- * - If the input is `null` or `undefined`, returns an empty string `("")`.
689
- *
635
+ * **Removes all spaces from a string or trims only, based on the options provided.**
636
+ * - **Behavior:**
637
+ * - If `trimOnly` is `true`, the string is simply trimmed.
638
+ * - Otherwise, removes **all spaces**, tabs, newlines, etc.
639
+ * - If the input is `null` or `undefined`, returns an empty string `("")`.
690
640
  * @param {string | null | undefined} value - The input string to be processed. If `null` or `undefined`, returns an empty string.
691
- * @param {object} [options] - The options object.
692
- * @param {boolean} [options.trimOnly=false] - If `true`, only trims the string without removing spaces inside.
641
+ * @param {RemoveSpacesOptions} [options] - The options object.
642
+ * @param {RemoveSpacesOptions["trimOnly"]} [options.trimOnly=false] - If `true`, only trims the string without removing spaces inside.
693
643
  * @returns {string} The processed string.
694
- *
695
644
  * @example
696
645
  * removeSpaces(" Hello World ");
697
646
  * // ➔ "HelloWorld"
698
- *
699
647
  * removeSpaces(" Hello World ", { trimOnly: true });
700
648
  * // ➔ "Hello World"
701
- *
702
649
  * removeSpaces(null);
703
650
  * // ➔ ""
704
651
  */
705
- declare const removeSpaces:(value?:string|null,options?:{
706
- /**
707
- * @description If true, only trims the string.
708
- *
709
- * @default false */
710
- trimOnly?:boolean;})=>string;
652
+ declare const removeSpaces:(value:string|null|undefined,options?:RemoveSpacesOptions)=>string;
711
653
  /** ----------------------------------------------------------
712
- * * ***Removes all HTML tags from a given string.***
654
+ * * ***Utility: `stripHtmlTags`.***
713
655
  * ----------------------------------------------------------
714
- *
715
- * This function removes valid HTML tags (including nested and self-closing ones)
716
- * by replacing them with spaces, then collapses multiple whitespaces into a single space.
717
- *
718
- * It handles the following cases:
719
- * - If the input is not a string (`null`, `undefined`, or any non-string), it is returned as undefined.
720
- * - If the input is an empty or whitespace-only string, it returns an empty string (`""`).
721
- * - Otherwise, it returns the cleaned string with tags removed and normalized whitespace.
722
- *
656
+ * **This function removes valid HTML tags (including nested and self-closing ones)
657
+ * by replacing them with spaces, then collapses multiple whitespaces into a single space.**
658
+ * - **It handles the following cases:**
659
+ * - If the input is not a string (`null`, `undefined`, or any non-string), it is returned as undefined.
660
+ * - If the input is an empty or whitespace-only string, it returns an empty string (`""`).
661
+ * - Otherwise, it returns the cleaned string with tags removed and normalized whitespace.
723
662
  * @template T - Input string type (string | null | undefined).
724
- * @param {T} [input] - A string potentially containing HTML tags.
725
- * @returns {T extends string ? string : T} - Cleaned string if input is string, or original input otherwise.
726
- *
663
+ * @param {string | null | undefined} input - A string potentially containing HTML tags.
664
+ * @returns {string | undefined} Cleaned string if input is string, or original input otherwise.
727
665
  * @example
728
666
  * stripHtmlTags("<p>Hello</p>");
729
667
  * // ➔ "Hello"
@@ -742,65 +680,52 @@ trimOnly?:boolean;})=>string;
742
680
  * stripHtmlTags(undefined);
743
681
  * // ➔ undefined
744
682
  */
745
- declare const stripHtmlTags:<T extends string|null|undefined=undefined>(input?:T)=>T extends string?string:undefined;
683
+ declare function stripHtmlTags(input:string):string;declare function stripHtmlTags<T>(input:T):Extends<string,T>extends true?string|undefined:undefined;
746
684
  /** ----------------------------------------------------------
747
- * * ***Replaces a substring at a specified index within a string.***
685
+ * * ***Utility: `replaceAt`.***
748
686
  * ----------------------------------------------------------
749
- *
750
- * @description
751
- * Replaces exactly one character at the specified index in the original string
752
- * with the provided `replaceTo` string. If `replaceTo` has more than one character,
687
+ * **Replaces exactly one character at the specified index in the original string
688
+ * with the provided `replaceTo` string.**
689
+ * - **Behavior:**
690
+ * - If `replaceTo` has more than one character,
753
691
  * the result will expand accordingly.
754
- *
755
692
  * @param {number} index - The starting index where the replacement should occur.
756
693
  * @param {string} originalString - The original string to modify.
757
694
  * @param {string} replaceTo - The string to insert at the specified index.
758
- * @returns {string} - The modified string with the replacement applied.
759
- *
695
+ * @returns {string} The modified string with the replacement applied.
760
696
  * @example
761
697
  * replaceAt(3, "hello", "X");
762
698
  * // ➔ "helXo"
763
- *
764
699
  * replaceAt(1, "world", "AB");
765
700
  * // ➔ "wABrld"
766
- *
767
701
  * replaceAt(0, "cat", "br");
768
702
  * // ➔ "brat"
769
- *
770
703
  * replaceAt(2, "12345", "-");
771
704
  * // ➔ "12-45"
772
- *
773
705
  * replaceAt(4, "ABCDE", "Z");
774
706
  * // ➔ "ABCDZ"
775
- *
776
707
  * // ❌ Examples that throw:
777
708
  * replaceAt(10, "short", "X");
778
- * // ➔ ❌ RangeError: Index parameter is out of range at function `replaceAt`
779
- *
709
+ * // ➔ ❌ RangeError: First parameter (`index`) is out of range from second parameter `originalString`.
780
710
  * replaceAt(-1, "test", "X");
781
- * // ➔ ❌ RangeError: Index parameter is out of range at function `replaceAt`
782
- *
711
+ * // ➔ ❌ RangeError: First parameter (`index`) is out of range from second parameter `originalString`.
783
712
  * replaceAt("1", "test", "X");
784
- * // ➔ ❌ TypeError: Expected 'index' to be a number, and 'replaceTo' and 'originalString' to be strings
785
- *
713
+ * // ➔ ❌ 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`,...]."
786
714
  * replaceAt(2, null, "X");
787
- * // ➔ ❌ TypeError: Expected 'index' to be a number, and 'replaceTo' and 'originalString' to be strings
715
+ * // ➔ ❌ 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`,...]."
788
716
  */
789
717
  declare const replaceAt:(index:number,originalString:string,replaceTo:string)=>string;
790
718
  /** ----------------------------------------------------------
791
- * * ***Extracts initials from a given name.***
719
+ * * ***Utility: `getInitialsName`.***
792
720
  * ----------------------------------------------------------
793
- *
794
- * @description
795
- * Extracts initials from the given name string.
796
- * - For names with two or more words, returns the first letter of the first and second words.
797
- * - For a single word with 2+ characters, returns the first two letters.
798
- * - For a single character, returns that character.
799
- * - For empty, null, or whitespace-only input, returns an empty string.
800
- *
801
- * @param {string} [name=""] - The name to extract initials from.
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.
802
728
  * @returns {string} The extracted initials (e.g., "JD" for "John Doe").
803
- *
804
729
  * @example
805
730
  * getInitialsName("Alice"); // ➔ "AL"
806
731
  * getInitialsName("John Doe"); // ➔ "JD"
@@ -808,9 +733,9 @@ declare const replaceAt:(index:number,originalString:string,replaceTo:string)=>s
808
733
  * getInitialsName("John Ronald Donal"); // ➔ "JR"
809
734
  * getInitialsName("Lord John Doe Moe"); // ➔ "LJ"
810
735
  * getInitialsName("X"); // ➔ "X"
811
- * getInitialsName(" "); // ➔ "" (empty string)
812
736
  * getInitialsName(""); // ➔ "" (empty string)
737
+ * getInitialsName(" "); // ➔ "" (empty string)
813
738
  * getInitialsName(null); // ➔ "" (null input)
814
739
  * getInitialsName(undefined); // ➔ "" (undefined input)
815
740
  */
816
- declare const getInitialsName:(name?:string|null)=>string;export{capitalizeFirst,capitalizeWords,getInitialsName,normalizeSpaces,normalizeString,removeSpaces,replaceAt,slugify,stripHtmlTags,toCamelCase,toDotCase,toKebabCase,toLowerCase,toPascalCase,toPascalCaseSpace,toSnakeCase};
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};