utilitify-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +338 -0
  3. package/dist/async.cjs +25 -0
  4. package/dist/async.cjs.map +1 -0
  5. package/dist/async.d.cts +104 -0
  6. package/dist/async.d.ts +104 -0
  7. package/dist/async.js +4 -0
  8. package/dist/async.js.map +1 -0
  9. package/dist/chunk-2ICNRTSN.cjs +346 -0
  10. package/dist/chunk-2ICNRTSN.cjs.map +1 -0
  11. package/dist/chunk-3DPF72DY.js +170 -0
  12. package/dist/chunk-3DPF72DY.js.map +1 -0
  13. package/dist/chunk-4CV4JOE5.js +24 -0
  14. package/dist/chunk-4CV4JOE5.js.map +1 -0
  15. package/dist/chunk-4SLYNSLH.cjs +783 -0
  16. package/dist/chunk-4SLYNSLH.cjs.map +1 -0
  17. package/dist/chunk-5WP7DWCG.js +1285 -0
  18. package/dist/chunk-5WP7DWCG.js.map +1 -0
  19. package/dist/chunk-BMQ6YPKV.js +876 -0
  20. package/dist/chunk-BMQ6YPKV.js.map +1 -0
  21. package/dist/chunk-BZCMWUKS.cjs +479 -0
  22. package/dist/chunk-BZCMWUKS.cjs.map +1 -0
  23. package/dist/chunk-C5R744DY.cjs +173 -0
  24. package/dist/chunk-C5R744DY.cjs.map +1 -0
  25. package/dist/chunk-C75J62CV.cjs +913 -0
  26. package/dist/chunk-C75J62CV.cjs.map +1 -0
  27. package/dist/chunk-CZLDE2OZ.cjs +28 -0
  28. package/dist/chunk-CZLDE2OZ.cjs.map +1 -0
  29. package/dist/chunk-DSMB6AF6.cjs +193 -0
  30. package/dist/chunk-DSMB6AF6.cjs.map +1 -0
  31. package/dist/chunk-ETWGPOPY.js +426 -0
  32. package/dist/chunk-ETWGPOPY.js.map +1 -0
  33. package/dist/chunk-FQBPVN63.cjs +403 -0
  34. package/dist/chunk-FQBPVN63.cjs.map +1 -0
  35. package/dist/chunk-G4GYQGTW.cjs +178 -0
  36. package/dist/chunk-G4GYQGTW.cjs.map +1 -0
  37. package/dist/chunk-GFDMZDMI.js +486 -0
  38. package/dist/chunk-GFDMZDMI.js.map +1 -0
  39. package/dist/chunk-HOTOYIPB.js +171 -0
  40. package/dist/chunk-HOTOYIPB.js.map +1 -0
  41. package/dist/chunk-HYADH4ZX.js +176 -0
  42. package/dist/chunk-HYADH4ZX.js.map +1 -0
  43. package/dist/chunk-JBN7C5WE.js +255 -0
  44. package/dist/chunk-JBN7C5WE.js.map +1 -0
  45. package/dist/chunk-JNCTPFTD.cjs +25 -0
  46. package/dist/chunk-JNCTPFTD.cjs.map +1 -0
  47. package/dist/chunk-N3BH3BV7.js +21 -0
  48. package/dist/chunk-N3BH3BV7.js.map +1 -0
  49. package/dist/chunk-NFPGAVRQ.js +749 -0
  50. package/dist/chunk-NFPGAVRQ.js.map +1 -0
  51. package/dist/chunk-OFFRGRBN.cjs +1332 -0
  52. package/dist/chunk-OFFRGRBN.cjs.map +1 -0
  53. package/dist/chunk-OZLKYIZL.cjs +490 -0
  54. package/dist/chunk-OZLKYIZL.cjs.map +1 -0
  55. package/dist/chunk-P3NUK46X.js +145 -0
  56. package/dist/chunk-P3NUK46X.js.map +1 -0
  57. package/dist/chunk-P7P2B7ZI.cjs +429 -0
  58. package/dist/chunk-P7P2B7ZI.cjs.map +1 -0
  59. package/dist/chunk-PB6SKSJN.cjs +150 -0
  60. package/dist/chunk-PB6SKSJN.cjs.map +1 -0
  61. package/dist/chunk-R3IXCJR7.js +378 -0
  62. package/dist/chunk-R3IXCJR7.js.map +1 -0
  63. package/dist/chunk-SD6P3WEJ.js +324 -0
  64. package/dist/chunk-SD6P3WEJ.js.map +1 -0
  65. package/dist/chunk-YSCHP26P.js +451 -0
  66. package/dist/chunk-YSCHP26P.js.map +1 -0
  67. package/dist/chunk-ZLMPRPCY.cjs +274 -0
  68. package/dist/chunk-ZLMPRPCY.cjs.map +1 -0
  69. package/dist/common-CBDYNJeh.d.cts +48 -0
  70. package/dist/common-CBDYNJeh.d.ts +48 -0
  71. package/dist/constants.cjs +42 -0
  72. package/dist/constants.cjs.map +1 -0
  73. package/dist/constants.d.cts +60 -0
  74. package/dist/constants.d.ts +60 -0
  75. package/dist/constants.js +5 -0
  76. package/dist/constants.js.map +1 -0
  77. package/dist/country/index.cjs +154 -0
  78. package/dist/country/index.cjs.map +1 -0
  79. package/dist/country/index.d.cts +1 -0
  80. package/dist/country/index.d.ts +1 -0
  81. package/dist/country/index.js +5 -0
  82. package/dist/country/index.js.map +1 -0
  83. package/dist/date/index.cjs +117 -0
  84. package/dist/date/index.cjs.map +1 -0
  85. package/dist/date/index.d.cts +283 -0
  86. package/dist/date/index.d.ts +283 -0
  87. package/dist/date/index.js +4 -0
  88. package/dist/date/index.js.map +1 -0
  89. package/dist/environment/index.cjs +73 -0
  90. package/dist/environment/index.cjs.map +1 -0
  91. package/dist/environment/index.d.cts +127 -0
  92. package/dist/environment/index.d.ts +127 -0
  93. package/dist/environment/index.js +4 -0
  94. package/dist/environment/index.js.map +1 -0
  95. package/dist/form/index.cjs +81 -0
  96. package/dist/form/index.cjs.map +1 -0
  97. package/dist/form/index.d.cts +227 -0
  98. package/dist/form/index.d.ts +227 -0
  99. package/dist/form/index.js +4 -0
  100. package/dist/form/index.js.map +1 -0
  101. package/dist/i18n.cjs +37 -0
  102. package/dist/i18n.cjs.map +1 -0
  103. package/dist/i18n.d.cts +102 -0
  104. package/dist/i18n.d.ts +102 -0
  105. package/dist/i18n.js +4 -0
  106. package/dist/i18n.js.map +1 -0
  107. package/dist/index-BXBmBHyL.d.ts +718 -0
  108. package/dist/index-BYsUCP3u.d.cts +718 -0
  109. package/dist/index-Cl26FrAZ.d.cts +362 -0
  110. package/dist/index-Cl26FrAZ.d.ts +362 -0
  111. package/dist/index.cjs +1265 -0
  112. package/dist/index.cjs.map +1 -0
  113. package/dist/index.d.cts +205 -0
  114. package/dist/index.d.ts +205 -0
  115. package/dist/index.js +277 -0
  116. package/dist/index.js.map +1 -0
  117. package/dist/schema.cjs +13 -0
  118. package/dist/schema.cjs.map +1 -0
  119. package/dist/schema.d.cts +84 -0
  120. package/dist/schema.d.ts +84 -0
  121. package/dist/schema.js +4 -0
  122. package/dist/schema.js.map +1 -0
  123. package/dist/security/index.cjs +94 -0
  124. package/dist/security/index.cjs.map +1 -0
  125. package/dist/security/index.d.cts +216 -0
  126. package/dist/security/index.d.ts +216 -0
  127. package/dist/security/index.js +5 -0
  128. package/dist/security/index.js.map +1 -0
  129. package/dist/string/index.cjs +153 -0
  130. package/dist/string/index.cjs.map +1 -0
  131. package/dist/string/index.d.cts +471 -0
  132. package/dist/string/index.d.ts +471 -0
  133. package/dist/string/index.js +4 -0
  134. package/dist/string/index.js.map +1 -0
  135. package/dist/transform/index.cjs +105 -0
  136. package/dist/transform/index.cjs.map +1 -0
  137. package/dist/transform/index.d.cts +271 -0
  138. package/dist/transform/index.d.ts +271 -0
  139. package/dist/transform/index.js +4 -0
  140. package/dist/transform/index.js.map +1 -0
  141. package/dist/validators/index.cjs +195 -0
  142. package/dist/validators/index.cjs.map +1 -0
  143. package/dist/validators/index.d.cts +2 -0
  144. package/dist/validators/index.d.ts +2 -0
  145. package/dist/validators/index.js +6 -0
  146. package/dist/validators/index.js.map +1 -0
  147. package/package.json +229 -0
@@ -0,0 +1,471 @@
1
+ /**
2
+ * Convert string to camelCase
3
+ *
4
+ * @param str - String to convert
5
+ * @returns camelCase string
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * toCamelCase('hello world'); // 'helloWorld'
10
+ * toCamelCase('hello-world'); // 'helloWorld'
11
+ * toCamelCase('HelloWorld'); // 'helloWorld'
12
+ * ```
13
+ */
14
+ declare function toCamelCase(str: string): string;
15
+ /**
16
+ * Convert string to PascalCase
17
+ *
18
+ * @param str - String to convert
19
+ * @returns PascalCase string
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * toPascalCase('hello world'); // 'HelloWorld'
24
+ * toPascalCase('hello-world'); // 'HelloWorld'
25
+ * ```
26
+ */
27
+ declare function toPascalCase(str: string): string;
28
+ /**
29
+ * Convert string to snake_case
30
+ *
31
+ * @param str - String to convert
32
+ * @returns snake_case string
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * toSnakeCase('helloWorld'); // 'hello_world'
37
+ * toSnakeCase('Hello World'); // 'hello_world'
38
+ * ```
39
+ */
40
+ declare function toSnakeCase(str: string): string;
41
+ /**
42
+ * Convert string to kebab-case
43
+ *
44
+ * @param str - String to convert
45
+ * @returns kebab-case string
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * toKebabCase('helloWorld'); // 'hello-world'
50
+ * toKebabCase('Hello World'); // 'hello-world'
51
+ * ```
52
+ */
53
+ declare function toKebabCase(str: string): string;
54
+ /**
55
+ * Convert string to Title Case
56
+ *
57
+ * @param str - String to convert
58
+ * @returns Title Case string
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * toTitleCase('hello world'); // 'Hello World'
63
+ * toTitleCase('the quick brown'); // 'The Quick Brown'
64
+ * ```
65
+ */
66
+ declare function toTitleCase(str: string): string;
67
+ /**
68
+ * Convert string to CONSTANT_CASE
69
+ *
70
+ * @param str - String to convert
71
+ * @returns CONSTANT_CASE string
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * toConstantCase('helloWorld'); // 'HELLO_WORLD'
76
+ * toConstantCase('Hello World'); // 'HELLO_WORLD'
77
+ * ```
78
+ */
79
+ declare function toConstantCase(str: string): string;
80
+ /**
81
+ * Convert string to Sentence case
82
+ *
83
+ * @param str - String to convert
84
+ * @returns Sentence case string
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * toSentenceCase('hello World'); // 'Hello world'
89
+ * toSentenceCase('HELLO WORLD'); // 'Hello world'
90
+ * ```
91
+ */
92
+ declare function toSentenceCase(str: string): string;
93
+ /**
94
+ * Convert string to dot.case
95
+ *
96
+ * @param str - String to convert
97
+ * @returns dot.case string
98
+ */
99
+ declare function toDotCase(str: string): string;
100
+ /**
101
+ * Capitalize first letter
102
+ *
103
+ * @param str - String to capitalize
104
+ * @returns Capitalized string
105
+ */
106
+ declare function capitalize(str: string): string;
107
+ /**
108
+ * Uncapitalize first letter
109
+ *
110
+ * @param str - String to uncapitalize
111
+ * @returns Uncapitalized string
112
+ */
113
+ declare function uncapitalize(str: string): string;
114
+ /**
115
+ * Swap case of each character
116
+ *
117
+ * @param str - String to swap
118
+ * @returns Swapped case string
119
+ */
120
+ declare function swapCase(str: string): string;
121
+
122
+ /**
123
+ * Slug generation options
124
+ */
125
+ interface SlugOptions {
126
+ /** Convert to lowercase (default: true) */
127
+ lowercase?: boolean;
128
+ /** Separator character (default: '-') */
129
+ separator?: string;
130
+ /** Maximum length (default: unlimited) */
131
+ maxLength?: number;
132
+ /** Transliterate non-ASCII characters (default: true) */
133
+ transliterate?: boolean;
134
+ /** Remove stop words (default: false) */
135
+ removeStopWords?: boolean;
136
+ }
137
+ /**
138
+ * Convert string to SEO-friendly slug
139
+ *
140
+ * @param str - String to convert
141
+ * @param options - Slug options
142
+ * @returns SEO-friendly slug
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * toSlug('Hello World!'); // 'hello-world'
147
+ * toSlug('Café & Restaurant'); // 'cafe-and-restaurant'
148
+ * toSlug('Hello World', { separator: '_' }); // 'hello_world'
149
+ * ```
150
+ */
151
+ declare function toSlug(str: string, options?: SlugOptions): string;
152
+ /**
153
+ * Transliterate non-ASCII characters to ASCII
154
+ *
155
+ * @param str - String to transliterate
156
+ * @returns Transliterated string
157
+ */
158
+ declare function transliterate(str: string): string;
159
+ /**
160
+ * Generate URL-safe slug from string
161
+ *
162
+ * @param str - String to slugify
163
+ * @returns URL-safe slug
164
+ */
165
+ declare function slugify(str: string): string;
166
+ /**
167
+ * Generate unique slug by appending number if needed
168
+ *
169
+ * @param str - Base string
170
+ * @param existingSlugs - Set of existing slugs
171
+ * @param options - Slug options
172
+ * @returns Unique slug
173
+ */
174
+ declare function uniqueSlug(str: string, existingSlugs: Set<string> | string[], options?: SlugOptions): string;
175
+ /**
176
+ * Check if string is a valid slug
177
+ *
178
+ * @param str - String to check
179
+ * @returns true if valid slug
180
+ */
181
+ declare function isValidSlug(str: string): boolean;
182
+
183
+ /**
184
+ * Mask options
185
+ */
186
+ interface MaskOptions {
187
+ /** Mask character (default: '*') */
188
+ maskChar?: string;
189
+ /** Number of visible chars at start (default: varies by type) */
190
+ visibleStart?: number;
191
+ /** Number of visible chars at end (default: varies by type) */
192
+ visibleEnd?: number;
193
+ /** Minimum string length to mask (default: 4) */
194
+ minLength?: number;
195
+ }
196
+ /**
197
+ * Mask an email address
198
+ *
199
+ * @param email - Email to mask
200
+ * @param options - Mask options
201
+ * @returns Masked email
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * maskEmail('john.doe@gmail.com'); // 'j***@gmail.com'
206
+ * maskEmail('test@example.com'); // 't***@example.com'
207
+ * ```
208
+ */
209
+ declare function maskEmail(email: string, options?: MaskOptions): string;
210
+ /**
211
+ * Mask a phone number
212
+ *
213
+ * @param phone - Phone to mask
214
+ * @param options - Mask options
215
+ * @returns Masked phone
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * maskPhone('+1 555-123-4567'); // '+1 *** *** 4567'
220
+ * maskPhone('03001234567'); // '030*****67'
221
+ * ```
222
+ */
223
+ declare function maskPhone(phone: string, options?: MaskOptions): string;
224
+ /**
225
+ * Mask a credit card number
226
+ *
227
+ * @param card - Card number to mask
228
+ * @param options - Mask options
229
+ * @returns Masked card number
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * maskCreditCard('4111 1111 1111 1111'); // '**** **** **** 1111'
234
+ * maskCreditCard('4111111111111111'); // '************1111'
235
+ * ```
236
+ */
237
+ declare function maskCreditCard(card: string, options?: MaskOptions): string;
238
+ /**
239
+ * Mask a generic string
240
+ *
241
+ * @param str - String to mask
242
+ * @param options - Mask options
243
+ * @returns Masked string
244
+ *
245
+ * @example
246
+ * ```typescript
247
+ * maskString('password123', { visibleStart: 2, visibleEnd: 2 }); // 'pa*******23'
248
+ * maskString('secret', { visibleEnd: 3 }); // '***ret'
249
+ * ```
250
+ */
251
+ declare function maskString(str: string, options?: MaskOptions): string;
252
+ /**
253
+ * Mask IP address
254
+ *
255
+ * @param ip - IP address to mask
256
+ * @returns Masked IP
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * maskIP('192.168.1.100'); // '192.168.***.***'
261
+ * ```
262
+ */
263
+ declare function maskIP(ip: string): string;
264
+ /**
265
+ * Mask name (for privacy)
266
+ *
267
+ * @param name - Name to mask
268
+ * @returns Masked name
269
+ *
270
+ * @example
271
+ * ```typescript
272
+ * maskName('John Doe'); // 'J*** D**'
273
+ * ```
274
+ */
275
+ declare function maskName(name: string): string;
276
+
277
+ /**
278
+ * Password generation options
279
+ */
280
+ interface PasswordOptions {
281
+ /** Password length (default: 16) */
282
+ length?: number;
283
+ /** Include uppercase letters (default: true) */
284
+ uppercase?: boolean;
285
+ /** Include lowercase letters (default: true) */
286
+ lowercase?: boolean;
287
+ /** Include numbers (default: true) */
288
+ numbers?: boolean;
289
+ /** Include symbols (default: true) */
290
+ symbols?: boolean;
291
+ /** Exclude ambiguous characters like 0, O, l, 1 (default: false) */
292
+ excludeAmbiguous?: boolean;
293
+ /** Custom characters to include */
294
+ customChars?: string;
295
+ /** Minimum number of each character type */
296
+ minOfEachType?: number;
297
+ }
298
+ /**
299
+ * Generate a random password
300
+ *
301
+ * @param options - Password options
302
+ * @returns Generated password
303
+ *
304
+ * @example
305
+ * ```typescript
306
+ * generatePassword(); // 'Xy7@mK9#pL2$nR4!'
307
+ * generatePassword({ length: 8, symbols: false }); // 'xY7mK9pL'
308
+ * ```
309
+ */
310
+ declare function generatePassword(options?: PasswordOptions): string;
311
+ /**
312
+ * Generate a random string
313
+ *
314
+ * @param length - Length of string
315
+ * @param charset - Character set to use
316
+ * @returns Random string
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * generateRandomString(10); // 'xK7mP9nL2s'
321
+ * generateRandomString(6, 'abc123'); // 'a1b2c3'
322
+ * ```
323
+ */
324
+ declare function generateRandomString(length?: number, charset?: string): string;
325
+ /**
326
+ * Generate a numeric OTP (One-Time Password)
327
+ *
328
+ * @param length - Length of OTP (default: 6)
329
+ * @returns OTP string
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * generateOTP(); // '482957'
334
+ * generateOTP(4); // '7382'
335
+ * ```
336
+ */
337
+ declare function generateOTP(length?: number): string;
338
+ /**
339
+ * Generate a memorable passphrase
340
+ *
341
+ * @param wordCount - Number of words
342
+ * @param separator - Word separator
343
+ * @returns Passphrase
344
+ *
345
+ * @example
346
+ * ```typescript
347
+ * generatePassphrase(4); // 'correct-horse-battery-staple'
348
+ * ```
349
+ */
350
+ declare function generatePassphrase(wordCount?: number, separator?: string): string;
351
+ /**
352
+ * Generate a hex string
353
+ *
354
+ * @param length - Length in bytes (output will be 2x this)
355
+ * @returns Hex string
356
+ */
357
+ declare function generateHexString(length?: number): string;
358
+ /**
359
+ * Generate a base64 string
360
+ *
361
+ * @param length - Approximate length
362
+ * @returns Base64 string
363
+ */
364
+ declare function generateBase64String(length?: number): string;
365
+ /**
366
+ * Generate URL-safe random string
367
+ *
368
+ * @param length - Length of string
369
+ * @returns URL-safe random string
370
+ */
371
+ declare function generateUrlSafeString(length?: number): string;
372
+
373
+ /**
374
+ * Truncation options
375
+ */
376
+ interface TruncateOptions {
377
+ /** Suffix to append (default: '...') */
378
+ suffix?: string;
379
+ /** Preserve word boundaries (default: true) */
380
+ preserveWords?: boolean;
381
+ /** Where to truncate: 'end', 'middle', 'start' (default: 'end') */
382
+ position?: 'end' | 'middle' | 'start';
383
+ /** Use grapheme-aware truncation for proper emoji handling (default: false) */
384
+ graphemeAware?: boolean;
385
+ }
386
+ /**
387
+ * Truncate a string to specified length
388
+ *
389
+ * @param str - String to truncate
390
+ * @param length - Maximum length (including suffix)
391
+ * @param options - Truncation options
392
+ * @returns Truncated string
393
+ *
394
+ * @example
395
+ * ```typescript
396
+ * truncate('Hello World', 8); // 'Hello...'
397
+ * truncate('Hello World', 8, { preserveWords: false }); // 'Hello...'
398
+ * truncate('Hello World', 8, { suffix: '…' }); // 'Hello W…'
399
+ * ```
400
+ */
401
+ declare function truncate(str: string, length: number, options?: TruncateOptions): string;
402
+ /**
403
+ * Truncate by word count
404
+ *
405
+ * @param str - String to truncate
406
+ * @param wordCount - Maximum number of words
407
+ * @param suffix - Suffix to append (default: '...')
408
+ * @returns Truncated string
409
+ *
410
+ * @example
411
+ * ```typescript
412
+ * truncateWords('The quick brown fox jumps', 3); // 'The quick brown...'
413
+ * ```
414
+ */
415
+ declare function truncateWords(str: string, wordCount: number, suffix?: string): string;
416
+ /**
417
+ * Truncate by sentence count
418
+ *
419
+ * @param str - String to truncate
420
+ * @param sentenceCount - Maximum number of sentences
421
+ * @param suffix - Suffix to append (default: '')
422
+ * @returns Truncated string
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * truncateSentences('Hello. World. Test.', 2); // 'Hello. World.'
427
+ * ```
428
+ */
429
+ declare function truncateSentences(str: string, sentenceCount: number, suffix?: string): string;
430
+ /**
431
+ * Truncate from middle, keeping file extension
432
+ * Useful for file names
433
+ *
434
+ * @param filename - Filename to truncate
435
+ * @param length - Maximum length
436
+ * @param separator - Separator to use (default: '...')
437
+ * @returns Truncated filename
438
+ *
439
+ * @example
440
+ * ```typescript
441
+ * truncateFilename('very_long_filename.pdf', 15); // 'very_l...me.pdf'
442
+ * ```
443
+ */
444
+ declare function truncateFilename(filename: string, length: number, separator?: string): string;
445
+ /**
446
+ * Ellipsis a string (alias for truncate with default options)
447
+ *
448
+ * @param str - String to ellipsis
449
+ * @param length - Maximum length
450
+ * @returns Ellipsized string
451
+ */
452
+ declare function ellipsis(str: string, length: number): string;
453
+ /**
454
+ * Smart truncate for HTML content (strips tags first)
455
+ *
456
+ * @param html - HTML string to truncate
457
+ * @param length - Maximum length
458
+ * @param suffix - Suffix to append
459
+ * @returns Truncated text (no HTML)
460
+ */
461
+ declare function truncateHtml(html: string, length: number, suffix?: string): string;
462
+ /**
463
+ * Check if string needs truncation
464
+ *
465
+ * @param str - String to check
466
+ * @param length - Maximum length
467
+ * @returns true if string exceeds length
468
+ */
469
+ declare function needsTruncation(str: string, length: number): boolean;
470
+
471
+ export { type MaskOptions, type PasswordOptions, type SlugOptions, type TruncateOptions, capitalize, ellipsis, generateBase64String, generateHexString, generateOTP, generatePassphrase, generatePassword, generateRandomString, generateUrlSafeString, isValidSlug, maskCreditCard, maskEmail, maskIP, maskName, maskPhone, maskString, needsTruncation, slugify, swapCase, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toSentenceCase, toSlug, toSnakeCase, toTitleCase, transliterate, truncate, truncateFilename, truncateHtml, truncateSentences, truncateWords, uncapitalize, uniqueSlug };