@visulima/string 3.0.0-alpha.1 → 3.0.0-alpha.3

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 (54) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE.md +374 -0
  3. package/README.md +24 -18
  4. package/dist/case/camel-case.d.ts +2 -2
  5. package/dist/case/camel-case.js +2 -2
  6. package/dist/case/capital-case.d.ts +2 -2
  7. package/dist/case/capital-case.js +2 -2
  8. package/dist/case/constant-case.d.ts +2 -2
  9. package/dist/case/dot-case.d.ts +2 -2
  10. package/dist/case/flat-case.d.ts +2 -2
  11. package/dist/case/flip-case.d.ts +2 -2
  12. package/dist/case/flip-case.js +8 -2
  13. package/dist/case/identify-case.d.ts +2 -2
  14. package/dist/case/index.d.ts +2 -2
  15. package/dist/case/index.js +1 -1
  16. package/dist/case/kebab-case.d.ts +2 -2
  17. package/dist/case/kebab-case.js +2 -2
  18. package/dist/case/lower-first.d.ts +2 -2
  19. package/dist/case/no-case.d.ts +2 -2
  20. package/dist/case/pascal-case.d.ts +2 -2
  21. package/dist/case/pascal-case.js +2 -2
  22. package/dist/case/pascal-snake-case.d.ts +2 -2
  23. package/dist/case/path-case.d.ts +2 -2
  24. package/dist/case/sentence-case.d.ts +2 -2
  25. package/dist/case/sentence-case.js +2 -2
  26. package/dist/case/snake-case.d.ts +2 -2
  27. package/dist/case/split-by-case.d.ts +2 -2
  28. package/dist/case/split-by-case.js +127 -24
  29. package/dist/case/title-case.d.ts +2 -2
  30. package/dist/case/train-case.d.ts +2 -2
  31. package/dist/case/train-case.js +1 -1
  32. package/dist/case/upper-first.d.ts +2 -2
  33. package/dist/closest-string.js +1 -3
  34. package/dist/get-string-truncated-width.js +1 -1
  35. package/dist/index.d.ts +11 -6
  36. package/dist/index.js +5 -4
  37. package/dist/native-string-types.d.ts +1 -1
  38. package/dist/outdent.js +2 -2
  39. package/dist/packem_shared/closestN-Cvsw0Fue.js +24 -0
  40. package/dist/packem_shared/{constants-CTzC6Gjg.js → constants-CnXdp6qx.js} +1 -1
  41. package/dist/packem_shared/excerpt-GvmR4ESb.js +1502 -0
  42. package/dist/packem_shared/{joinSegments-CuU8RGpP.js → joinSegments-B4H6oZ9b.js} +1 -1
  43. package/dist/packem_shared/{replaceString-vYvRBMfC.js → replaceString-BVlxk27d.js} +8 -8
  44. package/dist/packem_shared/{transliterate-CYnKKT8f.js → transliterate-a6LLM_Ei.js} +3 -5
  45. package/dist/packem_shared/{types-CfPsw9ix.d.ts → types-CHpmpy8C.d.ts} +1 -1
  46. package/dist/packem_shared/{types-Daae0hGf.d.ts → types-D2ydhHCv.d.ts} +1 -1
  47. package/dist/slice.js +1 -1
  48. package/dist/slugify.d.ts +1 -1
  49. package/dist/slugify.js +1 -1
  50. package/dist/truncate.js +38 -13
  51. package/dist/utilities.d.ts +1 -1
  52. package/dist/word-wrap.js +18 -18
  53. package/package.json +1 -1
  54. package/dist/packem_shared/closestN-BREy4E7C.js +0 -19
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## @visulima/string [3.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/string@3.0.0-alpha.2...@visulima/string@3.0.0-alpha.3) (2025-12-11)
2
+
3
+ ### Bug Fixes
4
+
5
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.3
11
+
12
+ ## @visulima/string [3.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/string@3.0.0-alpha.1...@visulima/string@3.0.0-alpha.2) (2025-12-08)
13
+
14
+ ### Features
15
+
16
+ * added new excerpt functions ([#582](https://github.com/visulima/visulima/issues/582)) ([1f2059f](https://github.com/visulima/visulima/commit/1f2059f79e8655d868cd9183d8645224c0af4fbb))
17
+
1
18
  ## @visulima/string [3.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/string@2.0.6...@visulima/string@3.0.0-alpha.1) (2025-12-07)
2
19
 
3
20
  ### ⚠ BREAKING CHANGES
package/LICENSE.md CHANGED
@@ -27,6 +27,36 @@ The published @visulima/string artifact additionally contains code with the foll
27
27
  MIT
28
28
 
29
29
  # Bundled dependencies:
30
+ ## codsen-utils
31
+ License: MIT
32
+ By: Roy Revelt
33
+ Repository: git+https://github.com/codsen/codsen.git
34
+
35
+ > MIT License
36
+ >
37
+ > Copyright © 2010-2025 Roy Revelt and other contributors
38
+ >
39
+ > Permission is hereby granted, free of charge, to any person obtaining
40
+ > a copy of this software and associated documentation files (the
41
+ > "Software"), to deal in the Software without restriction, including
42
+ > without limitation the rights to use, copy, modify, merge, publish,
43
+ > distribute, sublicense, and/or sell copies of the Software, and to
44
+ > permit persons to whom the Software is furnished to do so, subject to
45
+ > the following conditions:
46
+ >
47
+ > The above copyright notice and this permission notice shall be
48
+ > included in all copies or substantial portions of the Software.
49
+ >
50
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
51
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
52
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
53
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
54
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
55
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
56
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
57
+
58
+ ---------------------------------------
59
+
30
60
  ## emoji-regex-xs
31
61
  License: MIT
32
62
  By: Steven Levithan
@@ -100,6 +130,350 @@ Repository: sindresorhus/get-east-asian-width
100
130
  >
101
131
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
102
132
 
133
+ ---------------------------------------
134
+
135
+ ## html-entities
136
+ License: MIT
137
+ By: Marat Dulin
138
+ Repository: https://github.com/mdevils/html-entities.git
139
+
140
+ > Copyright (c) 2021 Dulin Marat
141
+ >
142
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
143
+ > of this software and associated documentation files (the "Software"), to deal
144
+ > in the Software without restriction, including without limitation the rights
145
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
146
+ > copies of the Software, and to permit persons to whom the Software is
147
+ > furnished to do so, subject to the following conditions:
148
+ >
149
+ > The above copyright notice and this permission notice shall be included in
150
+ > all copies or substantial portions of the Software.
151
+ >
152
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
154
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
155
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
156
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
157
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
158
+ > THE SOFTWARE.
159
+
160
+ ---------------------------------------
161
+
162
+ ## lodash-es
163
+ License: MIT
164
+ By: John-David Dalton, Mathias Bynens
165
+ Repository: lodash/lodash
166
+
167
+ > Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
168
+ >
169
+ > Based on Underscore.js, copyright Jeremy Ashkenas,
170
+ > DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
171
+ >
172
+ > This software consists of voluntary contributions made by many
173
+ > individuals. For exact contribution history, see the revision history
174
+ > available at https://github.com/lodash/lodash
175
+ >
176
+ > The following license applies to all parts of this software except as
177
+ > documented below:
178
+ >
179
+ > ====
180
+ >
181
+ > Permission is hereby granted, free of charge, to any person obtaining
182
+ > a copy of this software and associated documentation files (the
183
+ > "Software"), to deal in the Software without restriction, including
184
+ > without limitation the rights to use, copy, modify, merge, publish,
185
+ > distribute, sublicense, and/or sell copies of the Software, and to
186
+ > permit persons to whom the Software is furnished to do so, subject to
187
+ > the following conditions:
188
+ >
189
+ > The above copyright notice and this permission notice shall be
190
+ > included in all copies or substantial portions of the Software.
191
+ >
192
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
193
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
194
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
195
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
196
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
197
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
198
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
199
+ >
200
+ > ====
201
+ >
202
+ > Copyright and related rights for sample code are waived via CC0. Sample
203
+ > code is defined as all source code displayed within the prose of the
204
+ > documentation.
205
+ >
206
+ > CC0: http://creativecommons.org/publicdomain/zero/1.0/
207
+ >
208
+ > ====
209
+ >
210
+ > Files located in the node_modules and vendor directories are externally
211
+ > maintained libraries used by this software which have their own
212
+ > licenses; we recommend you read them, as their terms may differ from the
213
+ > terms above.
214
+
215
+ ---------------------------------------
216
+
217
+ ## ranges-apply
218
+ License: MIT
219
+ By: Roy Revelt
220
+ Repository: git+https://github.com/codsen/codsen.git
221
+
222
+ > MIT License
223
+ >
224
+ > Copyright © 2010-2025 Roy Revelt and other contributors
225
+ >
226
+ > Permission is hereby granted, free of charge, to any person obtaining
227
+ > a copy of this software and associated documentation files (the
228
+ > "Software"), to deal in the Software without restriction, including
229
+ > without limitation the rights to use, copy, modify, merge, publish,
230
+ > distribute, sublicense, and/or sell copies of the Software, and to
231
+ > permit persons to whom the Software is furnished to do so, subject to
232
+ > the following conditions:
233
+ >
234
+ > The above copyright notice and this permission notice shall be
235
+ > included in all copies or substantial portions of the Software.
236
+ >
237
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
238
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
239
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
240
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
241
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
242
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
243
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
244
+
245
+ ---------------------------------------
246
+
247
+ ## ranges-merge
248
+ License: MIT
249
+ By: Roy Revelt
250
+ Repository: git+https://github.com/codsen/codsen.git
251
+
252
+ > MIT License
253
+ >
254
+ > Copyright © 2010-2025 Roy Revelt and other contributors
255
+ >
256
+ > Permission is hereby granted, free of charge, to any person obtaining
257
+ > a copy of this software and associated documentation files (the
258
+ > "Software"), to deal in the Software without restriction, including
259
+ > without limitation the rights to use, copy, modify, merge, publish,
260
+ > distribute, sublicense, and/or sell copies of the Software, and to
261
+ > permit persons to whom the Software is furnished to do so, subject to
262
+ > the following conditions:
263
+ >
264
+ > The above copyright notice and this permission notice shall be
265
+ > included in all copies or substantial portions of the Software.
266
+ >
267
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
268
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
269
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
270
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
271
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
272
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
273
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
274
+
275
+ ---------------------------------------
276
+
277
+ ## ranges-push
278
+ License: MIT
279
+ By: Roy Revelt
280
+ Repository: git+https://github.com/codsen/codsen.git
281
+
282
+ > MIT License
283
+ >
284
+ > Copyright © 2010-2025 Roy Revelt and other contributors
285
+ >
286
+ > Permission is hereby granted, free of charge, to any person obtaining
287
+ > a copy of this software and associated documentation files (the
288
+ > "Software"), to deal in the Software without restriction, including
289
+ > without limitation the rights to use, copy, modify, merge, publish,
290
+ > distribute, sublicense, and/or sell copies of the Software, and to
291
+ > permit persons to whom the Software is furnished to do so, subject to
292
+ > the following conditions:
293
+ >
294
+ > The above copyright notice and this permission notice shall be
295
+ > included in all copies or substantial portions of the Software.
296
+ >
297
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
298
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
299
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
300
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
301
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
302
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
303
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
304
+
305
+ ---------------------------------------
306
+
307
+ ## ranges-sort
308
+ License: MIT
309
+ By: Roy Revelt
310
+ Repository: git+https://github.com/codsen/codsen.git
311
+
312
+ > MIT License
313
+ >
314
+ > Copyright © 2010-2025 Roy Revelt and other contributors
315
+ >
316
+ > Permission is hereby granted, free of charge, to any person obtaining
317
+ > a copy of this software and associated documentation files (the
318
+ > "Software"), to deal in the Software without restriction, including
319
+ > without limitation the rights to use, copy, modify, merge, publish,
320
+ > distribute, sublicense, and/or sell copies of the Software, and to
321
+ > permit persons to whom the Software is furnished to do so, subject to
322
+ > the following conditions:
323
+ >
324
+ > The above copyright notice and this permission notice shall be
325
+ > included in all copies or substantial portions of the Software.
326
+ >
327
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
328
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
329
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
330
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
331
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
332
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
333
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
334
+
335
+ ---------------------------------------
336
+
337
+ ## rfdc
338
+ License: MIT
339
+ By: David Mark Clements
340
+ Repository: git+https://github.com/davidmarkclements/rfdc.git
341
+
342
+ > Copyright 2019 "David Mark Clements <david.mark.clements@gmail.com>"
343
+ >
344
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
345
+ > documentation files (the "Software"), to deal in the Software without restriction, including without limitation
346
+ > the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
347
+ > to permit persons to whom the Software is furnished to do so, subject to the following conditions:
348
+ >
349
+ > The above copyright notice and this permission notice shall be included in all copies or substantial portions
350
+ > of the Software.
351
+ >
352
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
353
+ > TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
354
+ > THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
355
+ > CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
356
+ > IN THE SOFTWARE.
357
+
358
+ ---------------------------------------
359
+
360
+ ## string-collapse-leading-whitespace
361
+ License: MIT
362
+ By: Roy Revelt
363
+ Repository: git+https://github.com/codsen/codsen.git
364
+
365
+ > MIT License
366
+ >
367
+ > Copyright © 2010-2025 Roy Revelt and other contributors
368
+ >
369
+ > Permission is hereby granted, free of charge, to any person obtaining
370
+ > a copy of this software and associated documentation files (the
371
+ > "Software"), to deal in the Software without restriction, including
372
+ > without limitation the rights to use, copy, modify, merge, publish,
373
+ > distribute, sublicense, and/or sell copies of the Software, and to
374
+ > permit persons to whom the Software is furnished to do so, subject to
375
+ > the following conditions:
376
+ >
377
+ > The above copyright notice and this permission notice shall be
378
+ > included in all copies or substantial portions of the Software.
379
+ >
380
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
381
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
382
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
383
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
384
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
385
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
386
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
387
+
388
+ ---------------------------------------
389
+
390
+ ## string-left-right
391
+ License: MIT
392
+ By: Roy Revelt
393
+ Repository: git+https://github.com/codsen/codsen.git
394
+
395
+ > MIT License
396
+ >
397
+ > Copyright © 2010-2025 Roy Revelt and other contributors
398
+ >
399
+ > Permission is hereby granted, free of charge, to any person obtaining
400
+ > a copy of this software and associated documentation files (the
401
+ > "Software"), to deal in the Software without restriction, including
402
+ > without limitation the rights to use, copy, modify, merge, publish,
403
+ > distribute, sublicense, and/or sell copies of the Software, and to
404
+ > permit persons to whom the Software is furnished to do so, subject to
405
+ > the following conditions:
406
+ >
407
+ > The above copyright notice and this permission notice shall be
408
+ > included in all copies or substantial portions of the Software.
409
+ >
410
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
411
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
412
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
413
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
414
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
415
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
416
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
417
+
418
+ ---------------------------------------
419
+
420
+ ## string-strip-html
421
+ License: MIT
422
+ By: Roy Revelt
423
+ Repository: git+https://github.com/codsen/codsen.git
424
+
425
+ > MIT License
426
+ >
427
+ > Copyright © 2010-2025 Roy Revelt and other contributors
428
+ >
429
+ > Permission is hereby granted, free of charge, to any person obtaining
430
+ > a copy of this software and associated documentation files (the
431
+ > "Software"), to deal in the Software without restriction, including
432
+ > without limitation the rights to use, copy, modify, merge, publish,
433
+ > distribute, sublicense, and/or sell copies of the Software, and to
434
+ > permit persons to whom the Software is furnished to do so, subject to
435
+ > the following conditions:
436
+ >
437
+ > The above copyright notice and this permission notice shall be
438
+ > included in all copies or substantial portions of the Software.
439
+ >
440
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
441
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
442
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
443
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
444
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
445
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
446
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
447
+
448
+ ---------------------------------------
449
+
450
+ ## tiny-invariant
451
+ License: MIT
452
+ By: Alex Reardon
453
+ Repository: https://github.com/alexreardon/tiny-invariant.git
454
+
455
+ > MIT License
456
+ >
457
+ > Copyright (c) 2019 Alexander Reardon
458
+ >
459
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
460
+ > of this software and associated documentation files (the "Software"), to deal
461
+ > in the Software without restriction, including without limitation the rights
462
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
463
+ > copies of the Software, and to permit persons to whom the Software is
464
+ > furnished to do so, subject to the following conditions:
465
+ >
466
+ > The above copyright notice and this permission notice shall be included in all
467
+ > copies or substantial portions of the Software.
468
+ >
469
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
470
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
471
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
472
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
473
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
474
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
475
+ > SOFTWARE.
476
+
103
477
  <!-- /DEPENDENCIES -->
104
478
 
105
479
  <!-- TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -133,6 +133,25 @@
133
133
 
134
134
  ---
135
135
 
136
+ ## Documentation
137
+
138
+ Comprehensive documentation is available in the [`docs/`](./docs/) directory. The documentation includes:
139
+
140
+ - **[Getting Started](./docs/index.mdx)** - Overview and quick start guide
141
+ - **[Installation](./docs/installation.mdx)** - Installation instructions and setup
142
+ - **[Case Conversion](./docs/case-conversion.mdx)** - Case conversion utilities (camelCase, PascalCase, etc.)
143
+ - **[String Manipulation](./docs/string-manipulation.mdx)** - Text formatting, truncation, wrapping, and alignment
144
+ - **[Slugification](./docs/slugification.mdx)** - URL slug generation and transliteration
145
+ - **[String Width](./docs/string-width.mdx)** - Visual width calculation for Unicode strings
146
+ - **[String Similarity](./docs/string-similarity.mdx)** - String comparison and similarity algorithms
147
+ - **[Testing](./docs/testing.mdx)** - Testing utilities for ANSI strings
148
+ - **[TypeScript](./docs/typescript.mdx)** - TypeScript support and type definitions
149
+ - **[API Reference](./docs/api.mdx)** - Complete API reference
150
+
151
+ The documentation follows the [fumadocs.dev](https://fumadocs.dev) markdown format and can be integrated into your documentation site.
152
+
153
+ ---
154
+
136
155
  ## Install
137
156
 
138
157
  ```sh
@@ -815,19 +834,16 @@ paddedStr.trimEnd<typeof paddedStr>(); // type: ' hello'
815
834
  These enhanced types provide several benefits:
816
835
 
817
836
  1. **Compile-Time Type Safety**:
818
-
819
837
  - Catch type errors before runtime
820
838
  - Get accurate type inference for method results
821
839
  - Validate string operations at compile time
822
840
 
823
841
  2. **Better IDE Support**:
824
-
825
842
  - Improved autocompletion
826
843
  - More accurate type hints
827
844
  - Better refactoring support
828
845
 
829
846
  3. **Type-Level String Manipulation**:
830
-
831
847
  - Perform string operations at the type level
832
848
  - Get literal type results for string operations
833
849
  - Chain operations with type safety
@@ -1072,7 +1088,7 @@ const alignedEmojiText = alignText(emojiText, {
1072
1088
  align: "center",
1073
1089
  split: "*",
1074
1090
  pad: "-",
1075
- stringWidthOptions: { emojiWidth: 2 } // Crucial for correct width calculation with emojis
1091
+ stringWidthOptions: { emojiWidth: 2 }, // Crucial for correct width calculation with emojis
1076
1092
  });
1077
1093
  // alignedEmojiText (string output, exact padding depends on calculated widths):
1078
1094
  // "--Line1😊---\nWiderLine😊😊"
@@ -1082,10 +1098,10 @@ const alignedEmojiText = alignText(emojiText, {
1082
1098
 
1083
1099
  The `alignText` function accepts an `options` object of type `AlignTextOptions` with the following properties:
1084
1100
 
1085
- - `align?: "center" | "left" | "right"`: Specifies the alignment direction. Defaults to `"center"`. Note: `left` alignment primarily ensures line splitting if `text` is a single string; it doesn't typically add padding on the left unless the string was not pre-split.
1086
- - `pad?: string`: The character or string to use for padding. Defaults to `" "`.
1087
- - `split?: string`: The character or string used to split the input `text` into multiple lines if it's provided as a single string. Defaults to `"\n"`.
1088
- - `stringWidthOptions?: StringWidthOptions`: Options passed to an internal string width calculation function (similar to `getStringWidth`) for determining the visual width of each line. This is important for accurately handling ANSI escape codes, CJK characters, emojis, etc. Refer to the `getStringWidth` documentation for details on `StringWidthOptions`.
1101
+ - `align?: "center" | "left" | "right"`: Specifies the alignment direction. Defaults to `"center"`. Note: `left` alignment primarily ensures line splitting if `text` is a single string; it doesn't typically add padding on the left unless the string was not pre-split.
1102
+ - `pad?: string`: The character or string to use for padding. Defaults to `" "`.
1103
+ - `split?: string`: The character or string used to split the input `text` into multiple lines if it's provided as a single string. Defaults to `"\n"`.
1104
+ - `stringWidthOptions?: StringWidthOptions`: Options passed to an internal string width calculation function (similar to `getStringWidth`) for determining the visual width of each line. This is important for accurately handling ANSI escape codes, CJK characters, emojis, etc. Refer to the `getStringWidth` documentation for details on `StringWidthOptions`.
1089
1105
 
1090
1106
  ## Related
1091
1107
 
@@ -1132,22 +1148,12 @@ The visulima string is open-sourced software licensed under the [MIT][license]
1132
1148
  <!-- badges -->
1133
1149
 
1134
1150
  [license-badge]: https://img.shields.io/npm/l/@visulima/string?style=for-the-badge
1135
-
1136
1151
  [license]: https://github.com/visulima/visulima/blob/main/LICENSE
1137
-
1138
1152
  [npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/string?style=for-the-badge
1139
-
1140
1153
  [npm-downloads]: https://www.npmjs.com/package/@visulima/string
1141
-
1142
1154
  [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
1143
-
1144
1155
  [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
1145
-
1146
1156
  [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
1147
-
1148
1157
  [chat]: https://discord.gg/TtFJY8xkFK
1149
-
1150
1158
  [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
1151
-
1152
1159
  [typescript-url]: https://www.typescriptlang.org/
1153
-
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
@@ -1,10 +1,10 @@
1
- import { R as RE_FAST_ANSI } from '../packem_shared/constants-CTzC6Gjg.js';
1
+ import { R as RE_FAST_ANSI } from '../packem_shared/constants-CnXdp6qx.js';
2
2
  import LRUCache from '../packem_shared/LRUCache-3r3SovvR.js';
3
3
  import lowerFirst from './lower-first.js';
4
4
  import { splitByCase } from './split-by-case.js';
5
5
  import upperFirst from './upper-first.js';
6
6
  import { g as generateCacheKey } from '../packem_shared/generate-cache-key-DdayDfjV.js';
7
- import joinSegments from '../packem_shared/joinSegments-CuU8RGpP.js';
7
+ import joinSegments from '../packem_shared/joinSegments-B4H6oZ9b.js';
8
8
  import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-DEB8-ZPT.js';
9
9
 
10
10
  const defaultCacheStore = new LRUCache(1e3);
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
@@ -1,9 +1,9 @@
1
- import { R as RE_FAST_ANSI } from '../packem_shared/constants-CTzC6Gjg.js';
1
+ import { R as RE_FAST_ANSI } from '../packem_shared/constants-CnXdp6qx.js';
2
2
  import LRUCache from '../packem_shared/LRUCache-3r3SovvR.js';
3
3
  import { splitByCase } from './split-by-case.js';
4
4
  import upperFirst from './upper-first.js';
5
5
  import { g as generateCacheKey } from '../packem_shared/generate-cache-key-DdayDfjV.js';
6
- import joinSegments from '../packem_shared/joinSegments-CuU8RGpP.js';
6
+ import joinSegments from '../packem_shared/joinSegments-B4H6oZ9b.js';
7
7
  import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-DEB8-ZPT.js';
8
8
 
9
9
  const defaultCacheStore = new LRUCache(1e3);
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, D as DotCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, D as DotCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, d as FlipCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, d as FlipCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  type FlipOptions = Omit<CaseOptions, "handleEmoji">;
@@ -20,7 +20,7 @@ const __cjs_getBuiltinModule = (module) => {
20
20
  const {
21
21
  stripVTControlCharacters
22
22
  } = __cjs_getBuiltinModule("node:util");
23
- import { s as stripEmoji } from '../packem_shared/constants-CTzC6Gjg.js';
23
+ import { s as stripEmoji } from '../packem_shared/constants-CnXdp6qx.js';
24
24
  import LRUCache from '../packem_shared/LRUCache-3r3SovvR.js';
25
25
  import { g as generateCacheKey } from '../packem_shared/generate-cache-key-DdayDfjV.js';
26
26
 
@@ -64,7 +64,13 @@ const flipCase = (value, options) => {
64
64
  }
65
65
  const char = processedValue[index];
66
66
  const lowerChar = options?.locale ? char.toLocaleLowerCase(options.locale) : char.toLowerCase();
67
- result += char === lowerChar ? options?.locale ? char.toLocaleUpperCase(options.locale) : char.toUpperCase() : lowerChar;
67
+ let flippedChar;
68
+ if (char === lowerChar) {
69
+ flippedChar = options?.locale ? char.toLocaleUpperCase(options.locale) : char.toUpperCase();
70
+ } else {
71
+ flippedChar = lowerChar;
72
+ }
73
+ result += flippedChar;
68
74
  index += 1;
69
75
  }
70
76
  if (shouldCache && cacheKey) {
@@ -1,5 +1,5 @@
1
- import { I as IdentifyCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { I as IdentifyCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const identifyCase: <T extends string = string>(value?: T) => IdentifyCase<T>;
@@ -1,4 +1,4 @@
1
- export { N as NodeLocale } from '../packem_shared/types-Daae0hGf.js';
1
+ export { N as NodeLocale } from '../packem_shared/types-D2ydhHCv.js';
2
2
  export { default as camelCase } from './camel-case.js';
3
3
  export { default as capitalCase } from './capital-case.js';
4
4
  export { default as constantCase } from './constant-case.js';
@@ -17,7 +17,7 @@ export { default as snakeCase } from './snake-case.js';
17
17
  export { SplitOptions, splitByCase } from './split-by-case.js';
18
18
  export { default as titleCase } from './title-case.js';
19
19
  export { default as trainCase } from './train-case.js';
20
- export { a as CamelCase, b as CapitalCase, C as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from '../packem_shared/types-CfPsw9ix.js';
20
+ export { a as CamelCase, b as CapitalCase, C as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from '../packem_shared/types-CHpmpy8C.js';
21
21
  export { default as upperFirst } from './upper-first.js';
22
22
  import '../packem_shared/lru-cache-B_t27XwI.js';
23
23
 
@@ -17,4 +17,4 @@ export { splitByCase } from './split-by-case.js';
17
17
  export { default as titleCase } from './title-case.js';
18
18
  export { default as trainCase } from './train-case.js';
19
19
  export { default as upperFirst } from './upper-first.js';
20
- export { default as joinSegments } from '../packem_shared/joinSegments-CuU8RGpP.js';
20
+ export { default as joinSegments } from '../packem_shared/joinSegments-B4H6oZ9b.js';
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, K as KebabCase } from '../packem_shared/types-CfPsw9ix.js';
2
- import '../packem_shared/types-Daae0hGf.js';
1
+ import { C as CaseOptions, K as KebabCase } from '../packem_shared/types-CHpmpy8C.js';
2
+ import '../packem_shared/types-D2ydhHCv.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  interface KebabCaseOptions extends CaseOptions {