@visulima/string 3.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE.md +55 -129
  3. package/README.md +2 -2
  4. package/dist/align-text.d.ts +29 -29
  5. package/dist/align-text.js +2 -2
  6. package/dist/case/camel-case.d.ts +16 -16
  7. package/dist/case/camel-case.js +1 -1
  8. package/dist/case/capital-case.d.ts +13 -13
  9. package/dist/case/capital-case.js +1 -1
  10. package/dist/case/constant-case.d.ts +13 -13
  11. package/dist/case/constant-case.js +1 -1
  12. package/dist/case/dot-case.d.ts +13 -13
  13. package/dist/case/dot-case.js +1 -1
  14. package/dist/case/flat-case.d.ts +11 -11
  15. package/dist/case/flat-case.js +1 -1
  16. package/dist/case/flip-case.d.ts +14 -14
  17. package/dist/case/flip-case.js +1 -1
  18. package/dist/case/identify-case.d.ts +14 -14
  19. package/dist/case/identify-case.js +1 -1
  20. package/dist/case/index.d.ts +7 -7
  21. package/dist/case/index.js +1 -1
  22. package/dist/case/kebab-case.d.ts +22 -22
  23. package/dist/case/kebab-case.js +1 -1
  24. package/dist/case/lower-first.d.ts +12 -12
  25. package/dist/case/lower-first.js +1 -1
  26. package/dist/case/no-case.d.ts +13 -13
  27. package/dist/case/no-case.js +1 -1
  28. package/dist/case/pascal-case.d.ts +16 -16
  29. package/dist/case/pascal-case.js +1 -1
  30. package/dist/case/pascal-snake-case.d.ts +13 -13
  31. package/dist/case/pascal-snake-case.js +1 -1
  32. package/dist/case/path-case.d.ts +13 -13
  33. package/dist/case/path-case.js +1 -1
  34. package/dist/case/sentence-case.d.ts +13 -13
  35. package/dist/case/sentence-case.js +1 -1
  36. package/dist/case/snake-case.d.ts +13 -13
  37. package/dist/case/snake-case.js +1 -1
  38. package/dist/case/split-by-case.d.ts +20 -20
  39. package/dist/case/split-by-case.js +1 -1
  40. package/dist/case/title-case.d.ts +11 -11
  41. package/dist/case/title-case.js +1 -1
  42. package/dist/case/train-case.d.ts +13 -13
  43. package/dist/case/train-case.js +1 -1
  44. package/dist/case/upper-first.d.ts +12 -12
  45. package/dist/case/upper-first.js +1 -1
  46. package/dist/closest-string.d.ts +28 -28
  47. package/dist/closest-string.js +1 -1
  48. package/dist/compare-similarity.d.ts +33 -33
  49. package/dist/compare-similarity.js +1 -1
  50. package/dist/count-occurrences.d.ts +6 -6
  51. package/dist/count-occurrences.js +1 -1
  52. package/dist/direction.d.ts +4 -4
  53. package/dist/direction.js +1 -1
  54. package/dist/east-asian-width.d.ts +25 -15
  55. package/dist/east-asian-width.js +1 -1
  56. package/dist/excerpt.d.ts +18 -18
  57. package/dist/excerpt.js +55 -44
  58. package/dist/get-string-truncated-width.d.ts +131 -131
  59. package/dist/get-string-truncated-width.js +1 -1
  60. package/dist/get-string-width.d.ts +56 -56
  61. package/dist/indent.d.ts +11 -8
  62. package/dist/indent.js +1 -1
  63. package/dist/index.d.ts +4 -4
  64. package/dist/index.js +1 -1
  65. package/dist/is-fullwidth-code-point.d.ts +4 -4
  66. package/dist/is-fullwidth-code-point.js +1 -1
  67. package/dist/levenshtein.d.ts +19 -19
  68. package/dist/levenshtein.js +1 -1
  69. package/dist/native-string-types.d.ts +212 -228
  70. package/dist/outdent.d.ts +64 -64
  71. package/dist/outdent.js +1 -1
  72. package/dist/packem_shared/{_isFullWidth-Dqc3MWgl.js → _isFullWidth-dWWDw5Is.js} +1 -1
  73. package/dist/packem_shared/ansi-state-tracker-BFhXTS-5.js +1 -0
  74. package/dist/packem_shared/closest-CSX4px2F.js +1 -0
  75. package/dist/packem_shared/constants-BGGeBKGT.js +1 -0
  76. package/dist/packem_shared/dedent-CDXp3nZQ.js +1 -0
  77. package/dist/packem_shared/eastAsianWidth-DACe9Ds2.js +1 -0
  78. package/dist/packem_shared/generate-cache-key-th9N8-CB.js +1 -0
  79. package/dist/packem_shared/indent-CY079Qyq.js +1 -0
  80. package/dist/packem_shared/joinSegments-9qx7xSy7.js +1 -0
  81. package/dist/packem_shared/{lru-cache-BtMSrYQJ.js → lru-cache-BD25OaEQ.js} +1 -1
  82. package/dist/packem_shared/normalize-german-eszett-DtW4F-Wg.js +1 -0
  83. package/dist/packem_shared/redent-lctoaAtw.js +1 -0
  84. package/dist/packem_shared/strip-vt-control-characters-vMeu7uFw.js +1 -0
  85. package/dist/packem_shared/types.d-CMNqA5bi.d.ts +402 -0
  86. package/dist/packem_shared/types.d-LgsTR37y.d.ts +360 -0
  87. package/dist/replace-string.d.ts +7 -7
  88. package/dist/replace-string.js +1 -1
  89. package/dist/slice.d.ts +38 -38
  90. package/dist/slice.js +1 -1
  91. package/dist/slugify.d.ts +9 -9
  92. package/dist/slugify.js +1 -1
  93. package/dist/test/utils.d.ts +14 -14
  94. package/dist/test/utils.js +11 -11
  95. package/dist/test/vitest.d.ts +2 -2
  96. package/dist/transliterate.d.ts +7 -7
  97. package/dist/transliterate.js +3 -3
  98. package/dist/truncate.d.ts +37 -37
  99. package/dist/truncate.js +1 -1
  100. package/dist/utilities.d.ts +23 -23
  101. package/dist/utilities.js +1 -1
  102. package/dist/word-similarity-sort.d.ts +32 -32
  103. package/dist/word-similarity-sort.js +1 -1
  104. package/dist/word-wrap.d.ts +33 -33
  105. package/dist/word-wrap.js +5 -7
  106. package/package.json +1 -1
  107. package/dist/packem_shared/closest-C6YDQs4m.js +0 -1
  108. package/dist/packem_shared/constants-aPzGW29R.js +0 -1
  109. package/dist/packem_shared/dedent-CPjAYUXh.js +0 -1
  110. package/dist/packem_shared/eastAsianWidth-DJV8Kqd-.js +0 -1
  111. package/dist/packem_shared/generate-cache-key-BqU1Cqwm.js +0 -1
  112. package/dist/packem_shared/indent-cz8WMI0e.js +0 -1
  113. package/dist/packem_shared/joinSegments-CaHT-45s.js +0 -1
  114. package/dist/packem_shared/normalize-german-eszett-hNMwtGjd.js +0 -1
  115. package/dist/packem_shared/redent-ByOoJ6fN.js +0 -1
  116. package/dist/packem_shared/types.d-CmNvyl4l.d.ts +0 -360
  117. package/dist/packem_shared/types.d-fhe030jX.d.ts +0 -402
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## @visulima/string [3.1.1](https://github.com/visulima/visulima/compare/@visulima/string@3.1.0...@visulima/string@3.1.1) (2026-10-05)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **string:** preserve SGR across wraps, break CJK, ignore OSC width ([#833](https://github.com/visulima/visulima/issues/833)) ([fa54f39](https://github.com/visulima/visulima/commit/fa54f39b862223b406e84a3b021929ce907dedc7))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * point every Discord link at the anolilab server ([#858](https://github.com/visulima/visulima/issues/858)) ([4002bfc](https://github.com/visulima/visulima/commit/4002bfcd8d3c748d7008efe208e6aaae7bd18753))
10
+
11
+ ### Build System
12
+
13
+ * **deps:** refresh catalog and package manifests ([#832](https://github.com/visulima/visulima/issues/832)) ([9b7590d](https://github.com/visulima/visulima/commit/9b7590d6496e633ba2c0681484ae4497eeb824c9))
14
+
15
+ ## @visulima/string [3.1.0](https://github.com/visulima/visulima/compare/%40visulima%2Fstring%403.0.0...%40visulima%2Fstring%403.1.0) (2026-08-02)
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * **@visulima/colorize:** upgraded to 2.1.0
21
+
1
22
  ## @visulima/string [3.0.0](https://github.com/visulima/visulima/compare/@visulima/string@2.0.6...@visulima/string@3.0.0) (2026-07-03)
2
23
 
3
24
  ### ⚠ 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-format-diagnostic-value
31
+ License: MIT
32
+ By: Roy Revelt
33
+ Repository: git+https://github.com/codsen/codsen.git
34
+
35
+ > MIT License
36
+ >
37
+ > Copyright © 2010-2026 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
  ## codsen-utils
31
61
  License: MIT
32
62
  By: Roy Revelt
@@ -34,7 +64,7 @@ Repository: git+https://github.com/codsen/codsen.git
34
64
 
35
65
  > MIT License
36
66
  >
37
- > Copyright © 2010-2025 Roy Revelt and other contributors
67
+ > Copyright © 2010-2026 Roy Revelt and other contributors
38
68
  >
39
69
  > Permission is hereby granted, free of charge, to any person obtaining
40
70
  > a copy of this software and associated documentation files (the
@@ -132,68 +162,14 @@ Repository: sindresorhus/get-east-asian-width
132
162
 
133
163
  ---------------------------------------
134
164
 
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
- ## indent-string
165
+ ## html-entity-codec
163
166
  License: MIT
164
- By: Sindre Sorhus
165
- Repository: sindresorhus/indent-string
167
+ By: Roy Revelt
168
+ Repository: git+https://github.com/codsen/codsen.git
166
169
 
167
170
  > MIT License
168
171
  >
169
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
170
- >
171
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
172
- >
173
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
174
- >
175
- > 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.
176
-
177
- ---------------------------------------
178
-
179
- ## lodash-es
180
- License: MIT
181
- By: John-David Dalton, Mathias Bynens
182
- Repository: lodash/lodash
183
-
184
- > Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
185
- >
186
- > Based on Underscore.js, copyright Jeremy Ashkenas,
187
- > DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
188
- >
189
- > This software consists of voluntary contributions made by many
190
- > individuals. For exact contribution history, see the revision history
191
- > available at https://github.com/lodash/lodash
192
- >
193
- > The following license applies to all parts of this software except as
194
- > documented below:
195
- >
196
- > ====
172
+ > Copyright © 2010-2026 Roy Revelt and other contributors
197
173
  >
198
174
  > Permission is hereby granted, free of charge, to any person obtaining
199
175
  > a copy of this software and associated documentation files (the
@@ -213,21 +189,23 @@ Repository: lodash/lodash
213
189
  > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
214
190
  > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
215
191
  > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
192
+
193
+ ---------------------------------------
194
+
195
+ ## indent-string
196
+ License: MIT
197
+ By: Sindre Sorhus
198
+ Repository: sindresorhus/indent-string
199
+
200
+ > MIT License
216
201
  >
217
- > ====
218
- >
219
- > Copyright and related rights for sample code are waived via CC0. Sample
220
- > code is defined as all source code displayed within the prose of the
221
- > documentation.
202
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
222
203
  >
223
- > CC0: http://creativecommons.org/publicdomain/zero/1.0/
204
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
224
205
  >
225
- > ====
206
+ > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
226
207
  >
227
- > Files located in the node_modules and vendor directories are externally
228
- > maintained libraries used by this software which have their own
229
- > licenses; we recommend you read them, as their terms may differ from the
230
- > terms above.
208
+ > 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.
231
209
 
232
210
  ---------------------------------------
233
211
 
@@ -238,7 +216,7 @@ Repository: git+https://github.com/codsen/codsen.git
238
216
 
239
217
  > MIT License
240
218
  >
241
- > Copyright © 2010-2025 Roy Revelt and other contributors
219
+ > Copyright © 2010-2026 Roy Revelt and other contributors
242
220
  >
243
221
  > Permission is hereby granted, free of charge, to any person obtaining
244
222
  > a copy of this software and associated documentation files (the
@@ -268,7 +246,7 @@ Repository: git+https://github.com/codsen/codsen.git
268
246
 
269
247
  > MIT License
270
248
  >
271
- > Copyright © 2010-2025 Roy Revelt and other contributors
249
+ > Copyright © 2010-2026 Roy Revelt and other contributors
272
250
  >
273
251
  > Permission is hereby granted, free of charge, to any person obtaining
274
252
  > a copy of this software and associated documentation files (the
@@ -298,7 +276,7 @@ Repository: git+https://github.com/codsen/codsen.git
298
276
 
299
277
  > MIT License
300
278
  >
301
- > Copyright © 2010-2025 Roy Revelt and other contributors
279
+ > Copyright © 2010-2026 Roy Revelt and other contributors
302
280
  >
303
281
  > Permission is hereby granted, free of charge, to any person obtaining
304
282
  > a copy of this software and associated documentation files (the
@@ -328,7 +306,7 @@ Repository: git+https://github.com/codsen/codsen.git
328
306
 
329
307
  > MIT License
330
308
  >
331
- > Copyright © 2010-2025 Roy Revelt and other contributors
309
+ > Copyright © 2010-2026 Roy Revelt and other contributors
332
310
  >
333
311
  > Permission is hereby granted, free of charge, to any person obtaining
334
312
  > a copy of this software and associated documentation files (the
@@ -368,29 +346,6 @@ Repository: sindresorhus/redent
368
346
 
369
347
  ---------------------------------------
370
348
 
371
- ## rfdc
372
- License: MIT
373
- By: David Mark Clements
374
- Repository: git+https://github.com/davidmarkclements/rfdc.git
375
-
376
- > Copyright 2019 "David Mark Clements <david.mark.clements@gmail.com>"
377
- >
378
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
379
- > documentation files (the "Software"), to deal in the Software without restriction, including without limitation
380
- > the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
381
- > to permit persons to whom the Software is furnished to do so, subject to the following conditions:
382
- >
383
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions
384
- > of the Software.
385
- >
386
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
387
- > TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
388
- > THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
389
- > CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
390
- > IN THE SOFTWARE.
391
-
392
- ---------------------------------------
393
-
394
349
  ## string-collapse-leading-whitespace
395
350
  License: MIT
396
351
  By: Roy Revelt
@@ -398,7 +353,7 @@ Repository: git+https://github.com/codsen/codsen.git
398
353
 
399
354
  > MIT License
400
355
  >
401
- > Copyright © 2010-2025 Roy Revelt and other contributors
356
+ > Copyright © 2010-2026 Roy Revelt and other contributors
402
357
  >
403
358
  > Permission is hereby granted, free of charge, to any person obtaining
404
359
  > a copy of this software and associated documentation files (the
@@ -428,7 +383,7 @@ Repository: git+https://github.com/codsen/codsen.git
428
383
 
429
384
  > MIT License
430
385
  >
431
- > Copyright © 2010-2025 Roy Revelt and other contributors
386
+ > Copyright © 2010-2026 Roy Revelt and other contributors
432
387
  >
433
388
  > Permission is hereby granted, free of charge, to any person obtaining
434
389
  > a copy of this software and associated documentation files (the
@@ -458,7 +413,7 @@ Repository: git+https://github.com/codsen/codsen.git
458
413
 
459
414
  > MIT License
460
415
  >
461
- > Copyright © 2010-2025 Roy Revelt and other contributors
416
+ > Copyright © 2010-2026 Roy Revelt and other contributors
462
417
  >
463
418
  > Permission is hereby granted, free of charge, to any person obtaining
464
419
  > a copy of this software and associated documentation files (the
@@ -496,35 +451,6 @@ Repository: sindresorhus/strip-indent
496
451
  >
497
452
  > 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.
498
453
 
499
- ---------------------------------------
500
-
501
- ## tiny-invariant
502
- License: MIT
503
- By: Alex Reardon
504
- Repository: https://github.com/alexreardon/tiny-invariant.git
505
-
506
- > MIT License
507
- >
508
- > Copyright (c) 2019 Alexander Reardon
509
- >
510
- > Permission is hereby granted, free of charge, to any person obtaining a copy
511
- > of this software and associated documentation files (the "Software"), to deal
512
- > in the Software without restriction, including without limitation the rights
513
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
514
- > copies of the Software, and to permit persons to whom the Software is
515
- > furnished to do so, subject to the following conditions:
516
- >
517
- > The above copyright notice and this permission notice shall be included in all
518
- > copies or substantial portions of the Software.
519
- >
520
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
521
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
522
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
523
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
524
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
525
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
526
- > SOFTWARE.
527
-
528
454
  <!-- /DEPENDENCIES -->
529
455
 
530
456
  <!-- TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -1277,7 +1277,7 @@ The visulima string is open-sourced software licensed under the [MIT][license]
1277
1277
  [npm-downloads]: https://www.npmjs.com/package/@visulima/string
1278
1278
  [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
1279
1279
  [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
1280
- [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
1281
- [chat]: https://discord.gg/TtFJY8xkFK
1280
+ [chat-badge]: https://img.shields.io/discord/902465130518949899.svg?style=for-the-badge
1281
+ [chat]: https://discord.gg/eajEZvk2PG
1282
1282
  [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
1283
1283
  [typescript-url]: https://www.typescriptlang.org/
@@ -1,45 +1,45 @@
1
1
  import { StringWidthOptions } from "./get-string-width.js";
2
2
  import "./get-string-truncated-width.js";
3
3
  /**
4
- * Options for controlling the text alignment.
5
- */
4
+ * Options for controlling the text alignment.
5
+ */
6
6
  type AlignTextOptions = {
7
7
  /**
8
- * The alignment direction.
9
- * @default "center"
10
- */
8
+ * The alignment direction.
9
+ * @default "center"
10
+ */
11
11
  align?: "center" | "left" | "right";
12
12
  /**
13
- * Character used for padding when aligning text.
14
- * @default " "
15
- */
13
+ * Character used for padding when aligning text.
14
+ * @default " "
15
+ */
16
16
  pad?: string;
17
17
  /**
18
- * The character to split the input string by, if it's a single string.
19
- * @default "\n"
20
- */
18
+ * The character to split the input string by, if it's a single string.
19
+ * @default "\n"
20
+ */
21
21
  split?: string;
22
22
  /**
23
- * Options to pass to `getStringWidth` for calculating the width of each line.
24
- */
23
+ * Options to pass to `getStringWidth` for calculating the width of each line.
24
+ */
25
25
  stringWidthOptions?: StringWidthOptions;
26
26
  };
27
27
  /**
28
- * Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
29
- * @example
30
- * ```typescript
31
- * alignText("Hello\nWorld!", { align: "right" });
32
- * // => " Hello\nWorld!"
33
- *
34
- * alignText(["Beep", "Boop\nBop"], { align: "center" });
35
- * // => [
36
- * // " Beep",
37
- * // "Boop\n Bop"
38
- * // ]
39
- * ```
40
- * @param text The string or array of strings to align.
41
- * @param options Options for controlling the alignment.
42
- * @returns The aligned string or array of strings, matching the input type.
43
- */
28
+ * Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
29
+ * @example
30
+ * ```typescript
31
+ * alignText("Hello\nWorld!", { align: "right" });
32
+ * // => " Hello\nWorld!"
33
+ *
34
+ * alignText(["Beep", "Boop\nBop"], { align: "center" });
35
+ * // => [
36
+ * // " Beep",
37
+ * // "Boop\n Bop"
38
+ * // ]
39
+ * ```
40
+ * @param text The string or array of strings to align.
41
+ * @param options Options for controlling the alignment.
42
+ * @returns The aligned string or array of strings, matching the input type.
43
+ */
44
44
  declare const alignText: (text: string[] | string, options?: AlignTextOptions) => string[] | string;
45
45
  export { AlignTextOptions, alignText };
@@ -1,2 +1,2 @@
1
- import{getStringWidth as f}from"./get-string-width.js";const m=(t,r)=>Math.floor((t-r)/2),c=(t,r)=>t-r,u=(t,r={})=>{const s=r.align??"center";if(s==="left")return t;const a=r.split??`
2
- `,g=r.pad??" ",h=s==="right"?c:m;let l=!1,i;Array.isArray(t)?i=t:(l=!0,i=t.split(a));let o,e=0;const p=i.map(n=>(o=f(n,r.stringWidthOptions),e=Math.max(o,e),{str:n,width:o})).map(n=>Array.from({length:h(e,n.width)+1}).join(g)+n.str);return l?p.join(a):p};export{u as alignText};
1
+ import{getStringWidth as g}from"./get-string-width.js";const d=(t,r)=>Math.floor((t-r)/2),m=(t,r)=>t-r,p=(t,r={})=>{const s=r.align??"center";if(s==="left")return t;const a=r.split??`
2
+ `,o=r.pad??" ",c=s==="right"?m:d;let f=!1,n;Array.isArray(t)?n=t:(f=!0,n=t.split(a));let l,e=0;const h=n.map(i=>(l=g(i,r.stringWidthOptions),e=Math.max(l,e),{str:i,width:l})).map(i=>Array.from({length:c(e,i.width)+1}).join(o)+i.str);return f?h.join(a):h};export{p as alignText};
@@ -1,19 +1,19 @@
1
- import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to camelCase.
5
- * @param value The string to convert.
6
- * @param options Options for case conversion.
7
- * @returns The string in camelCase.
8
- * @example
9
- * ```typescript
10
- * camelCase('foo bar') // 'fooBar'
11
- * camelCase('foo-bar') // 'fooBar'
12
- * camelCase('foo_bar') // 'fooBar'
13
- * camelCase('XMLHttpRequest') // 'xmlHttpRequest'
14
- * camelCase('AJAXRequest') // 'ajaxRequest'
15
- * camelCase('QueryXML123String') // 'queryXml123String'
16
- * ```
17
- */
4
+ * Converts a string to camelCase.
5
+ * @param value The string to convert.
6
+ * @param options Options for case conversion.
7
+ * @returns The string in camelCase.
8
+ * @example
9
+ * ```typescript
10
+ * camelCase('foo bar') // 'fooBar'
11
+ * camelCase('foo-bar') // 'fooBar'
12
+ * camelCase('foo_bar') // 'fooBar'
13
+ * camelCase('XMLHttpRequest') // 'xmlHttpRequest'
14
+ * camelCase('AJAXRequest') // 'ajaxRequest'
15
+ * camelCase('QueryXML123String') // 'queryXml123String'
16
+ * ```
17
+ */
18
18
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
19
19
  export { camelCase as default };
@@ -1 +1 @@
1
- import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import f from"./lower-first.js";import{splitByCase as A}from"./split-by-case.js";import h from"./upper-first.js";import{n as d}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import u from"../packem_shared/joinSegments-CaHT-45s.js";import{a as w}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const y=new p(1e3),_=(t,o)=>{if(typeof t!="string"||!t)return"";const i=o?.cache??!1,n=o?.cacheStore??y;let r;if(i&&(r=d(t,o)),i&&r&&n.has(r))return n.get(r);let a=!0;const e=u(A(t,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(s=>{if(o?.handleAnsi&&c.test(s))return s;const m=o?.locale?.startsWith("de")?w(s):s,l=o?.locale?m.toLocaleLowerCase(o.locale):m.toLowerCase();return a?(a=!1,f(l,o)):h(l,o)}),"");return i&&r&&n.set(r,e),e};export{_ as default};
1
+ import{c as o}from"../packem_shared/constants-BGGeBKGT.js";import{L as f}from"../packem_shared/lru-cache-BD25OaEQ.js";import h from"./lower-first.js";import{splitByCase as d}from"./split-by-case.js";import u from"./upper-first.js";import{g as A}from"../packem_shared/generate-cache-key-th9N8-CB.js";import C from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as y}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const E=new f(1e3),k=(a,e)=>{if(typeof a!="string"||!a)return"";const m=e?.cache??!1,s=e?.cacheStore??E;let r;if(m&&(r=A(a,e)),m&&r&&s.has(r))return s.get(r);let c=!0;const l=C(d(a,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(t=>{if(e?.handleAnsi&&o.test(t))return t;const n=e?.locale?.startsWith("de")?y(t):t,i=e?.locale?n.toLocaleLowerCase(e.locale):n.toLowerCase();return c?(c=!1,h(i,e)):u(i,e)}),"");return m&&r&&s.set(r,l),l};export{k as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to Capital Case.
5
- * @example
6
- * ```typescript
7
- * capitalCase("foo bar") // => "Foo Bar"
8
- * capitalCase("foo-bar") // => "Foo Bar"
9
- * capitalCase("foo_bar") // => "Foo Bar"
10
- * capitalCase("XMLHttpRequest") // => "Xml Http Request"
11
- * capitalCase("AJAXRequest") // => "Ajax Request"
12
- * capitalCase("QueryXML123String") // => "Query Xml 123 String"
13
- * ```
14
- */
4
+ * Converts a string to Capital Case.
5
+ * @example
6
+ * ```typescript
7
+ * capitalCase("foo bar") // => "Foo Bar"
8
+ * capitalCase("foo-bar") // => "Foo Bar"
9
+ * capitalCase("foo_bar") // => "Foo Bar"
10
+ * capitalCase("XMLHttpRequest") // => "Xml Http Request"
11
+ * capitalCase("AJAXRequest") // => "Ajax Request"
12
+ * capitalCase("QueryXML123String") // => "Query Xml 123 String"
13
+ * ```
14
+ */
15
15
  declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
16
16
  export { capitalCase as default };
@@ -1 +1 @@
1
- import{c as m}from"../packem_shared/constants-aPzGW29R.js";import{i as c}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{n as h}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import A from"../packem_shared/joinSegments-CaHT-45s.js";import{a as d}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const u=new c(1e3),S=(s,o)=>{if(typeof s!="string")return"";const i=o?.cache??!1,a=o?.cacheStore??u;let r;if(i&&(r=h(s,o)),i&&r&&a.has(r))return a.get(r);const l=p(s,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(t=>{if(m.test(t))return t;const e=o?.locale?.startsWith("de")?d(t):t;return f(o?.locale?e.toLocaleLowerCase(o.locale):e.toLocaleLowerCase(),o)}),n=A(l," ");return i&&r&&a.set(r,n),n};export{S as default};
1
+ import{c as n}from"../packem_shared/constants-BGGeBKGT.js";import{L as i}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as f}from"./split-by-case.js";import h from"./upper-first.js";import{g as d}from"../packem_shared/generate-cache-key-th9N8-CB.js";import p from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as u}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const A=new i(1e3),z=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,c=e?.cacheStore??A;let r;if(s&&(r=d(t,e)),s&&r&&c.has(r))return c.get(r);const m=f(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(a=>{if(n.test(a))return a;const l=e?.locale?.startsWith("de")?u(a):a;return h(e?.locale?l.toLocaleLowerCase(e.locale):l.toLocaleLowerCase(),e)}),o=p(m," ");return s&&r&&c.set(r,o),o};export{z as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to CONSTANT_CASE.
5
- * @example
6
- * ```typescript
7
- * constantCase("foo bar") // => "FOO_BAR"
8
- * constantCase("foo-bar") // => "FOO_BAR"
9
- * constantCase("foo_bar") // => "FOO_BAR"
10
- * constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
11
- * constantCase("AJAXRequest") // => "AJAX_REQUEST"
12
- * constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
13
- * ```
14
- */
4
+ * Converts a string to CONSTANT_CASE.
5
+ * @example
6
+ * ```typescript
7
+ * constantCase("foo bar") // => "FOO_BAR"
8
+ * constantCase("foo-bar") // => "FOO_BAR"
9
+ * constantCase("foo_bar") // => "FOO_BAR"
10
+ * constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
11
+ * constantCase("AJAXRequest") // => "AJAX_REQUEST"
12
+ * constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
13
+ * ```
14
+ */
15
15
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
16
16
  export { constantCase as default };
@@ -1 +1 @@
1
- import{i as r}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{kebabCase as t}from"./kebab-case.js";const a=new r(1e3),m=(e,o)=>t(e,{cacheStore:a,...o,joiner:"_",toUpperCase:!0});export{m as default};
1
+ import{L as a}from"../packem_shared/lru-cache-BD25OaEQ.js";import{kebabCase as o}from"./kebab-case.js";const r=new a(1e3),n=(e,t)=>o(e,{cacheStore:r,...t,joiner:"_",toUpperCase:!0});export{n as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to dot.case.
5
- * @example
6
- * ```typescript
7
- * dotCase("foo bar") // => "foo.bar"
8
- * dotCase("foo-bar") // => "foo.bar"
9
- * dotCase("foo_bar") // => "foo.bar"
10
- * dotCase("XMLHttpRequest") // => "xml.http.request"
11
- * dotCase("AJAXRequest") // => "ajax.request"
12
- * dotCase("QueryXML123String") // => "query.xml.123.string"
13
- * ```
14
- */
4
+ * Converts a string to dot.case.
5
+ * @example
6
+ * ```typescript
7
+ * dotCase("foo bar") // => "foo.bar"
8
+ * dotCase("foo-bar") // => "foo.bar"
9
+ * dotCase("foo_bar") // => "foo.bar"
10
+ * dotCase("XMLHttpRequest") // => "xml.http.request"
11
+ * dotCase("AJAXRequest") // => "ajax.request"
12
+ * dotCase("QueryXML123String") // => "query.xml.123.string"
13
+ * ```
14
+ */
15
15
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
16
16
  export { dotCase as default };
@@ -1 +1 @@
1
- import{i as r}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{kebabCase as a}from"./kebab-case.js";const t=new r(1e3),c=(e,o)=>a(e,{cacheStore:t,...o,joiner:"."});export{c as default};
1
+ import{L as a}from"../packem_shared/lru-cache-BD25OaEQ.js";import{kebabCase as t}from"./kebab-case.js";const r=new a(1e3),f=(e,o)=>t(e,{cacheStore:r,...o,joiner:"."});export{f as default};
@@ -1,14 +1,14 @@
1
- import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to flat case (all lowercase, no separators).
5
- * @example
6
- * ```typescript
7
- * flatCase("foo-barBaz") // => "foobarbaz"
8
- * flatCase("XMLHttpRequest") // => "xmlhttprequest"
9
- * flatCase("AJAXRequest") // => "ajaxrequest"
10
- * flatCase("QueryXML123String") // => "queryxml123string"
11
- * ```
12
- */
4
+ * Converts a string to flat case (all lowercase, no separators).
5
+ * @example
6
+ * ```typescript
7
+ * flatCase("foo-barBaz") // => "foobarbaz"
8
+ * flatCase("XMLHttpRequest") // => "xmlhttprequest"
9
+ * flatCase("AJAXRequest") // => "ajaxrequest"
10
+ * flatCase("QueryXML123String") // => "queryxml123string"
11
+ * ```
12
+ */
13
13
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
14
14
  export { flatCase as default };
@@ -1 +1 @@
1
- import{i as r}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{kebabCase as t}from"./kebab-case.js";const a=new r(1e3),c=(e,o)=>t(e,{cacheStore:a,...o,joiner:""});export{c as default};
1
+ import{L as o}from"../packem_shared/lru-cache-BD25OaEQ.js";import{kebabCase as t}from"./kebab-case.js";const r=new o(1e3),f=(e,a)=>t(e,{cacheStore:r,...a,joiner:""});export{f as default};
@@ -1,19 +1,19 @@
1
- import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Options specific to flip case operations.
5
- * Note: handleEmoji is not needed as the function preserves emojis by default
6
- */
4
+ * Options specific to flip case operations.
5
+ * Note: handleEmoji is not needed as the function preserves emojis by default
6
+ */
7
7
  type FlipOptions = Omit<CaseOptions, "handleEmoji">;
8
8
  /**
9
- * Flips the case of each character in a string.
10
- * @example
11
- * ```typescript
12
- * flipCase("FooBar") // => "fOObAR"
13
- * flipCase("foobar") // => "FOOBAR"
14
- * flipCase("FOOBAR") // => "foobar"
15
- * flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
16
- * ```
17
- */
9
+ * Flips the case of each character in a string.
10
+ * @example
11
+ * ```typescript
12
+ * flipCase("FooBar") // => "fOObAR"
13
+ * flipCase("foobar") // => "FOOBAR"
14
+ * flipCase("FOOBAR") // => "foobar"
15
+ * flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
16
+ * ```
17
+ */
18
18
  declare const flipCase: <T extends string = string>(value?: T, options?: FlipOptions) => FlipCase<T>;
19
19
  export { FlipOptions, flipCase };