@visulima/string 3.1.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.
- package/CHANGELOG.md +14 -0
- package/LICENSE.md +55 -129
- package/README.md +2 -2
- package/dist/align-text.js +2 -2
- package/dist/case/camel-case.js +1 -1
- package/dist/case/capital-case.js +1 -1
- package/dist/case/constant-case.js +1 -1
- package/dist/case/dot-case.js +1 -1
- package/dist/case/flat-case.js +1 -1
- package/dist/case/flip-case.js +1 -1
- package/dist/case/identify-case.js +1 -1
- package/dist/case/index.js +1 -1
- package/dist/case/kebab-case.js +1 -1
- package/dist/case/lower-first.js +1 -1
- package/dist/case/no-case.js +1 -1
- package/dist/case/pascal-case.js +1 -1
- package/dist/case/pascal-snake-case.js +1 -1
- package/dist/case/path-case.js +1 -1
- package/dist/case/sentence-case.js +1 -1
- package/dist/case/snake-case.js +1 -1
- package/dist/case/split-by-case.js +1 -1
- package/dist/case/title-case.js +1 -1
- package/dist/case/train-case.js +1 -1
- package/dist/case/upper-first.js +1 -1
- package/dist/closest-string.js +1 -1
- package/dist/compare-similarity.js +1 -1
- package/dist/count-occurrences.js +1 -1
- package/dist/direction.js +1 -1
- package/dist/east-asian-width.d.ts +5 -1
- package/dist/east-asian-width.js +1 -1
- package/dist/excerpt.js +55 -44
- package/dist/get-string-truncated-width.js +1 -1
- package/dist/indent.d.ts +3 -1
- package/dist/indent.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/is-fullwidth-code-point.js +1 -1
- package/dist/levenshtein.js +1 -1
- package/dist/outdent.js +1 -1
- package/dist/packem_shared/{_isFullWidth-Dqc3MWgl.js → _isFullWidth-dWWDw5Is.js} +1 -1
- package/dist/packem_shared/ansi-state-tracker-BFhXTS-5.js +1 -0
- package/dist/packem_shared/closest-CSX4px2F.js +1 -0
- package/dist/packem_shared/constants-BGGeBKGT.js +1 -0
- package/dist/packem_shared/dedent-CDXp3nZQ.js +1 -0
- package/dist/packem_shared/eastAsianWidth-DACe9Ds2.js +1 -0
- package/dist/packem_shared/generate-cache-key-th9N8-CB.js +1 -0
- package/dist/packem_shared/indent-CY079Qyq.js +1 -0
- package/dist/packem_shared/joinSegments-9qx7xSy7.js +1 -0
- package/dist/packem_shared/{lru-cache-BtMSrYQJ.js → lru-cache-BD25OaEQ.js} +1 -1
- package/dist/packem_shared/normalize-german-eszett-DtW4F-Wg.js +1 -0
- package/dist/packem_shared/redent-lctoaAtw.js +1 -0
- package/dist/packem_shared/{strip-vt-control-characters-BW1RglLp.js → strip-vt-control-characters-vMeu7uFw.js} +1 -1
- package/dist/replace-string.js +1 -1
- package/dist/slice.js +1 -1
- package/dist/slugify.js +1 -1
- package/dist/test/utils.js +10 -10
- package/dist/transliterate.js +3 -3
- package/dist/truncate.js +1 -1
- package/dist/utilities.js +1 -1
- package/dist/word-similarity-sort.js +1 -1
- package/dist/word-wrap.js +5 -7
- package/package.json +1 -1
- package/dist/packem_shared/closest-C6YDQs4m.js +0 -1
- package/dist/packem_shared/constants-aPzGW29R.js +0 -1
- package/dist/packem_shared/dedent-CPjAYUXh.js +0 -1
- package/dist/packem_shared/eastAsianWidth-DJV8Kqd-.js +0 -1
- package/dist/packem_shared/generate-cache-key-B_0X7MKm.js +0 -1
- package/dist/packem_shared/indent-cz8WMI0e.js +0 -1
- package/dist/packem_shared/joinSegments-CaHT-45s.js +0 -1
- package/dist/packem_shared/normalize-german-eszett-hNMwtGjd.js +0 -1
- package/dist/packem_shared/redent-ByOoJ6fN.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
1
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)
|
|
2
16
|
|
|
3
17
|
|
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-
|
|
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-
|
|
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:
|
|
165
|
-
Repository:
|
|
167
|
+
By: Roy Revelt
|
|
168
|
+
Repository: git+https://github.com/codsen/codsen.git
|
|
166
169
|
|
|
167
170
|
> MIT License
|
|
168
171
|
>
|
|
169
|
-
> Copyright
|
|
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
|
-
>
|
|
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
|
-
>
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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/
|
|
1281
|
-
[chat]: https://discord.gg/
|
|
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/
|
package/dist/align-text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getStringWidth as
|
|
2
|
-
`,
|
|
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};
|
package/dist/case/camel-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-
|
|
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 +1 @@
|
|
|
1
|
-
import{c as
|
|
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 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/case/dot-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/case/flat-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/case/flip-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as
|
|
1
|
+
import{s as C}from"../packem_shared/constants-BGGeBKGT.js";import{L as m}from"../packem_shared/lru-cache-BD25OaEQ.js";import{s as p}from"../packem_shared/strip-vt-control-characters-vMeu7uFw.js";import{g}from"../packem_shared/generate-cache-key-th9N8-CB.js";const d=new m(1e3),x=(c,t)=>{if(typeof c!="string"||c.length===0)return"";const h=t?.cache??!1,o=t?.cacheStore??d;let a;if(h&&(a=g(c,t)),h&&a&&o.has(a))return o.get(a);let e=c;t?.stripEmoji&&(e=C(e)),t?.stripAnsi&&(e=p(e));let s="",r=0;for(;r<e.length;){if(t?.handleAnsi&&e[r]==="\x1B"){let f=e[r];for(r+=1;r<e.length&&e[r]!=="m";)f+=e[r],r+=1;r<e.length&&(f+=e[r],s+=f),r+=1;continue}const l=e[r],n=t?.locale?l.toLocaleLowerCase(t.locale):l.toLowerCase();let i;l===n?i=t?.locale?l.toLocaleUpperCase(t.locale):l.toUpperCase():i=n,s+=i,r+=1}return h&&a&&o.set(a,s),s};export{x as flipCase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=/^([A-Z][a-z]*)+$/,s=/[a-z]/i,E=/^[A-Z0-9_]+$/,_=/^[a-z0-9_]+$/,i=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,S=/^[a-z ]+$/,A=/^[A-Z][A-Z0-9]*$/,o=/\s+/,c=/^\d+$/,I=/^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)+$/,f=/^[a-z]/,C=/[.!?;:,](?!\s|$)/,u=t=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(!t||!s.test(t))return"unknown";if(t.includes("_"))return E.test(t)?"upper_snake":_.test(t)?"snake":"mixed";if(t.includes("-"))return i.test(t)?"kebab":"mixed";if(S.test(t))return"lower";if(A.test(t))return"upper";const n=t.split(o);return n.length>1&&n.every(r=>e.test(r))||n.length>1&&c.test(n[0])&&e.test(n[1])?"title":n.length>1&&e.test(n[0])&&f.test(n[1])?"sentence":e.test(t)?"pascal":I.test(t)?"camel":C.test(t)?"unknown":"mixed"};export{u as default};
|
package/dist/case/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"./camel-case.js";import{default as r}from"./capital-case.js";import{default as f}from"./constant-case.js";import{default as l}from"./dot-case.js";import{default as x}from"./flat-case.js";import{flipCase as u}from"./flip-case.js";import{default as n}from"./identify-case.js";import{kebabCase as c}from"./kebab-case.js";import{default as b}from"./lower-first.js";import{default as F}from"./no-case.js";import{default as g}from"./pascal-case.js";import{default as j}from"./pascal-snake-case.js";import{default as B}from"./path-case.js";import{default as v}from"./sentence-case.js";import{default as A}from"./snake-case.js";import{splitByCase as E}from"./split-by-case.js";import{default as H}from"./title-case.js";import{default as J}from"./train-case.js";import{default as L}from"./upper-first.js";import{default as N}from"../packem_shared/joinSegments-
|
|
1
|
+
import{default as t}from"./camel-case.js";import{default as r}from"./capital-case.js";import{default as f}from"./constant-case.js";import{default as l}from"./dot-case.js";import{default as x}from"./flat-case.js";import{flipCase as u}from"./flip-case.js";import{default as n}from"./identify-case.js";import{kebabCase as c}from"./kebab-case.js";import{default as b}from"./lower-first.js";import{default as F}from"./no-case.js";import{default as g}from"./pascal-case.js";import{default as j}from"./pascal-snake-case.js";import{default as B}from"./path-case.js";import{default as v}from"./sentence-case.js";import{default as A}from"./snake-case.js";import{splitByCase as E}from"./split-by-case.js";import{default as H}from"./title-case.js";import{default as J}from"./train-case.js";import{default as L}from"./upper-first.js";import{default as N}from"../packem_shared/joinSegments-9qx7xSy7.js";export{t as camelCase,r as capitalCase,f as constantCase,l as dotCase,x as flatCase,u as flipCase,n as identifyCase,N as joinSegments,c as kebabCase,b as lowerFirst,F as noCase,g as pascalCase,j as pascalSnakeCase,B as pathCase,v as sentenceCase,A as snakeCase,E as splitByCase,H as titleCase,J as trainCase,L as upperFirst};
|
package/dist/case/kebab-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-
|
|
1
|
+
import{c as o}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{g as h}from"../packem_shared/generate-cache-key-th9N8-CB.js";import C from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as u}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const A=new i(1e3),g=(t,e)=>{if(typeof t!="string")return"";const c=e?.cache??!1,s=e?.cacheStore??A;let r;if(c&&(r=h(t,e)),c&&r&&s.has(r))return s.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(e?.handleAnsi&&o.test(a))return a;if(e?.toUpperCase)return e.locale?a.toLocaleUpperCase(e.locale):a.toUpperCase();const n=e?.locale?.startsWith("de")?u(a):a;return e?.locale?n.toLocaleLowerCase(e.locale):n.toLowerCase()}),l=C(m,e?.joiner??"-");return c&&r&&s.set(r,l),l};export{g as kebabCase};
|
package/dist/case/lower-first.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o=(r,t)=>typeof r!="string"||r===""?"":(t?.locale?r[0].toLocaleLowerCase(t.locale):r[0].toLowerCase())+r.slice(1);export{o as default};
|
package/dist/case/no-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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),n=(e,o)=>t(e,{cacheStore:r,...o,joiner:" "});export{n as default};
|
package/dist/case/pascal-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
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 o}from"./split-by-case.js";import f from"./upper-first.js";import{g as h}from"../packem_shared/generate-cache-key-th9N8-CB.js";import A from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as C}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const d=new i(1e3),L=(a,e)=>{if(typeof a!="string"||!a)return"";const c=e?.cache??!1,l=e?.cacheStore??d;let r;if(c&&(r=h(a,e)),c&&r&&l.has(r))return l.get(r);const s=A(o(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&&n.test(t))return t;const m=e?.locale?.startsWith("de")?C(t):t;return f(e?.locale?m.toLocaleLowerCase(e.locale):m.toLowerCase(),{locale:e?.locale})}),"");return c&&r&&l.set(r,s),s};export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as f}from"../packem_shared/lru-cache-BD25OaEQ.js";import h from"./no-case.js";import l from"./upper-first.js";import{g as n}from"../packem_shared/generate-cache-key-th9N8-CB.js";const m=new f(1e3),g=(a,r)=>{if(typeof a!="string")return"";const t=r?.cache??!1,c=r?.cacheStore??m;let e;if(t&&(e=n(a,r)),t&&e&&c.has(e))return c.get(e);const s=h(a,{...r,cache:!1}).split(" ").map(o=>l(o,{locale:r?.locale})).join("_");return t&&e&&c.set(e,s),s};export{g as default};
|
package/dist/case/path-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-
|
|
1
|
+
import{c as o}from"../packem_shared/constants-BGGeBKGT.js";import{L as f}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as h}from"./split-by-case.js";import d from"./upper-first.js";import{g as u}from"../packem_shared/generate-cache-key-th9N8-CB.js";import A from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as C}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const y=new f(1e3),w=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,c=e?.cacheStore??y;let r;if(s&&(r=u(t,e)),s&&r&&c.has(r))return c.get(r);let l=!0;const n=A(h(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(e?.handleAnsi&&o.test(a))return a;const m=e?.locale?.startsWith("de")?C(a):a,i=e?.locale?m.toLocaleLowerCase(e.locale):m.toLowerCase();return l?(l=!1,d(i,e)):i})," ");return s&&r&&c.set(r,n),n};export{w as default};
|
package/dist/case/snake-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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),n=(e,a)=>t(e,{cacheStore:r,...a,joiner:"_"});export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{R as x,s as V,c as S,l as w,m as R,n as W,o as M,p as P,q as F,r as O,t as Y,u as B,v as D,w as G,x as q,y as $,z as Z,A as Q,B as X,C as tt,D as et,E as st,F as nt,G as rt,H as it,I as at,J as ot,K as pt,L as lt,M as ht,N as ct}from"../packem_shared/constants-BGGeBKGT.js";import{L as ft}from"../packem_shared/lru-cache-BD25OaEQ.js";import{s as ut}from"../packem_shared/strip-vt-control-characters-vMeu7uFw.js";const b=new ft(1e3),gt=/[.*+?^${}()|[\]\\]/g,dt=t=>{const i=t.join("");if(b.has(i)){const C=b.get(i);return C.lastIndex=0,C}const h=t.map(C=>C.replaceAll(gt,String.raw`\$&`)).join("|"),g=new RegExp(h,"g");return b.set(i,g),g},Ct=t=>{const i=[];let h=0,g;for(x.lastIndex=0;(g=x.exec(t))!==null;)g.index>h&&i.push(t.slice(h,g.index)),i.push(g[0]),h=x.lastIndex;return h<t.length&&i.push(t.slice(h)),i.filter(Boolean)},Et=/[ČŠŽĐ]/i,y=new Uint8Array(128),H=new Uint8Array(128),T=new Uint8Array(128);for(let t=0;t<128;t++)y[t]=t>=65&&t<=90?1:0,H[t]=t>=97&&t<=122?1:0,T[t]=t>=48&&t<=57?1:0;const k=t=>y[t],K=t=>H[t],N=t=>T[t],_=(t,i,h,g,C)=>{if(t.length===0)return[];let f=!1;const U=Object.values(i);for(const s of U)if(s(t[0])){f=!0;break}if(!f&&!h)return[t];const u=[...t],A=[];let e=u[0],a="other";const l=Object.entries(i);for(const s of l){const[r,p]=s;if(p(u[0])){a=r;break}}let n=h&&g?u[0]===u[0].toLocaleUpperCase(g):!1;for(let s=1;s<u.length;s++){const r=u[s];let p="other";for(const d of l){const[E,I]=d;if(I(r)){p=E;break}}const c=h&&g?r===r.toLocaleUpperCase(g):!1;let o=!1;C?o=C(a,p,n,c,r,s,u):(a!==p&&a!=="other"&&p!=="other"&&(o=!0),h&&p!=="other"&&!n&&c&&(o=!0)),o?(A.push(e),e=r):e+=r,a=p,h&&(n=c)}return e&&e.length>0&&A.push(e),A.length>0?A:[t]},At=(t,i,h,g)=>{if(h.size===0)return i;for(const C of h)if(t.startsWith(C,i))return g.push(C),i+C.length;return i},z=(t,i=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let h=0;const g=[],C=t.length;for(let f=1;f<C;f++){const U=At(t,h,i,g);if(U!==h){h=U,f=h-1;continue}const u=t.codePointAt(f-1),A=t.codePointAt(f),e=u&&u<128&&k(u),a=A&&A<128&&k(A),l=u&&u<128&&K(u),n=u&&u<128&&N(u),s=A&&A<128&&N(A);if(l&&a){g.push(t.slice(h,f)),h=f;continue}if(n&&!s||!n&&s){g.push(t.slice(h,f)),h=f;continue}if(s&&!n){let r=!1,p=!1;if(f+1<C){const c=t.codePointAt(f+1);r=c&&c<128&&k(c),p=c&&c<128&&N(c)}if(!p&&r){g.push(t.slice(h,f),t.slice(f,f+1)),h=f+1;continue}}if(f+1<C){const r=t.codePointAt(f+1),p=r&&r<128&&K(r);if(e&&a&&p){const c=t.slice(h,f+1);i.has(c)||(g.push(t.slice(h,f)),h=f)}}}return h<C&&g.push(t.slice(h)),g.filter(f=>f!=="")},v=(t,i,h)=>{if(t.length===0)return[];const g=t===t.toLocaleUpperCase(i);if(i.startsWith("de")){if(!g&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(i))return[t];const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i),r=s,p=s?0:-1;for(let c=1;c<a;c++){const o=e[c],d=o===o.toLocaleUpperCase(i);if(d===s)n+=o;else if(d)n&&n.length>0&&(l.push(n),n=o),r=!0,p=c;else{if(r&&c-p>1){const E=e[c-1],I=n.slice(0,-1);I&&I.length>0&&l.push(I),n=E+o}else n+=o;r=!1,p=-1}s=d}return n&&n.length>0&&l.push(n),l}if(i.startsWith("uk")||i.startsWith("ru")||i.startsWith("bg")||i.startsWith("sr")||i.startsWith("mk")||i.startsWith("be")){if(!w.test(t)&&!R.test(t))return[t];const e=[...t],a=e.length,l=[];let n=e[0];const s=e[0];let r;w.test(s)?r=1:R.test(s)?r=2:r=0;let p=s===s.toLocaleUpperCase(i);for(let o=1;o<a;o++){const d=e[o];let E;w.test(d)?E=1:R.test(d)?E=2:E=0;const I=d===d.toLocaleUpperCase(i);r!==E&&(r===1||r===2)&&(E===1||E===2)||E===r&&!p&&I?(l.push(n),n=d):n+=d,r=E,p=I}n&&n.length>0&&l.push(n);const c=[];for(let o=0;o<l.length;o++)o<l.length-1&&l[o].length===1&&R.test(l[o])&&w.test(l[o+1][0])?(c.push(l[o]+l[o+1]),o+=1):c.push(l[o]);return c}if(i.startsWith("el")){if(!W.test(t)&&!R.test(t))return[t];const e=[];M.lastIndex=0;let a;for(;(a=M.exec(t))!==null;)e.push(a[0]);e.length===0&&e.push(t);const l=[];if(e.length===1){const s=e[0];if(!s||!W.test(s[0])||s.length===1)return[s??t]}for(const s of e){if(!s)continue;if(!W.test(s[0])||s.length===1){l.push(s);continue}const r=s.length;let p=s[0],c=s[0]===s[0].toLocaleUpperCase(i);for(let o=1;o<r;o++){const d=s[o],E=d===d.toLocaleUpperCase(i);!c&&E?(l.push(p),p=d):p+=d,c=E}p&&l.push(p)}return l}if(i.startsWith("ja")||i.startsWith("ko")){const e=i.startsWith("ja"),a=e?{hiragana:n=>Y.test(n),kanji:n=>O.test(n),katakana:n=>F.test(n),latin:n=>R.test(n)}:{hangul:n=>B.test(n),latin:n=>R.test(n)},l=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(e){const n=_(t,a,!1,i,(r,p)=>r==="hiragana"&&p==="katakana"||r==="katakana"&&p==="hiragana"||r==="hiragana"&&p==="latin"||r==="katakana"&&p==="latin"||r==="kanji"&&p==="latin"||r==="latin"&&(p==="hiragana"||p==="katakana"||p==="kanji")),s=[];for(const r of n){const p=r;p.length===1&&l.has(p)&&s.length>0?s[s.length-1]=s.at(-1)+p:s.push(p)}return s.length>0?s:[t]}return _(t,a,!1,i,(n,s)=>n==="hangul"&&s==="latin"||n==="latin"&&s==="hangul")}if(i.startsWith("sl")){const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i);for(let r=1;r<a;r++){const p=e[r],c=p===p.toLocaleUpperCase(i),o=Et.test(p),d=r<a-1&&e[r+1]===e[r+1].toLocaleUpperCase(i);!s&&c||o&&d?(l.push(n),n=p,o&&d&&(l.push(n),n="")):n+=p,s=c}return n&&n.length>0&&l.push(n),l}if(i.startsWith("zh"))return _(t,{han:e=>O.test(e),latin:e=>R.test(e)},!1,i);if(["ar","fa","he","ur"].includes(i.split("-")[0])){const e=a=>D.test(a)||G.test(a);return _(t,{latin:a=>R.test(a),rtl:a=>e(a)},!1,i)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(i.split("-")[0])){const e=a=>$.test(a)||Z.test(a)||Q.test(a)||X.test(a)||tt.test(a)||et.test(a)||st.test(a)||nt.test(a)||rt.test(a)||it.test(a)||at.test(a)||ot.test(a)||pt.test(a)||lt.test(a)||ht.test(a)||ct.test(a);return _(t,{indic:a=>e(a),latin:a=>R.test(a)},!1,i)}if(["be","bg","ru","sr","uk"].includes(i))return _(t,{cyrillic:e=>w.test(e),latin:e=>R.test(e)},!0,i);if(["ar","fa","he"].includes(i))return _(t,{latin:e=>R.test(e),rtl:e=>D.test(e)||G.test(e)},!1,i);if(i.startsWith("ko"))return _(t,{hangul:e=>B.test(e),latin:e=>R.test(e)},!1,i);if(i.startsWith("uz")){if(!w.test(t)&&!R.test(t))return[t];const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i);for(let r=1;r<a;r++){const p=e[r],c=p===p.toLocaleUpperCase(i);if(P.test(p)||P.test(e[r-1])){n+=p;continue}!s&&c?(l.push(n),n=p):n+=p,s=c}return n&&n.length>0&&l.push(n),l}const C=[...t],f=C.length,U=[];let u=C[0],A=C[0]===C[0].toLocaleUpperCase(i);for(const e of h)if(t.startsWith(e)){U.push(e),u=C[e.length],A=u===u.toLocaleUpperCase(i);break}for(let e=1;e<f;e++){const a=C[e],l=a===a.toLocaleUpperCase(i);let n=0;for(const s of h)if(t.startsWith(s,e)){U.push(u,s),n=s.length,u="";const r=s.at(-1);r&&(A=r===r.toLocaleUpperCase(i));break}if(n>0){e+=n-1;continue}!A&&l?(U.push(u),u=a):u+=a,A=l}return u&&U.push(u),U},Ut=(t,i,h)=>{const g=[],C=S.test(t)?t.split(S).filter(Boolean):[t];for(const f of C){const U=f;if(S.test(U))g.push(U);else{x.lastIndex=0;const u=x.test(U)?Ct(U).filter(Boolean):[U];for(const A of u)if(x.lastIndex=0,x.test(A))g.push(A);else if(i){const e=i.toLowerCase().split("-")[0];g.push(...v(A,e,h))}else g.push(...z(A,h))}}return g},mt=(t,i={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:h=!1,handleEmoji:g=!1,knownAcronyms:C=[],locale:f,normalize:U=!1,separators:u,stripAnsi:A=!1,stripEmoji:e=!1}=i,a=new Set([...C].toSorted((o,d)=>d.length-o.length));let l=t;A&&(l=ut(l)),e&&(l=V(l));let n;Array.isArray(u)?n=dt(u):u instanceof RegExp?n=u:n=q;const s=[];let r=l;const p=n.flags.includes("g")?n:new RegExp(n.source,`${n.flags}g`);for(;r.length>0;){const o=p.exec(r);if(!o){r===".."?s.push(".."):r==="."?s.push("."):r.length>0&&s.push(r);break}const d=o.index,E=o[0],I=E.length,j=r.slice(0,d),J=r.slice(d+I);if(E.startsWith("../"))s.push(".."),r=r.slice(d+3);else if(E.startsWith("./"))s.push("."),r=r.slice(d+2);else if(d===0&&E==="..")s.push(".."),r=r.slice(2);else if(d===0&&E===".")s.push("."),r=r.slice(1);else{j.length>0&&s.push(j);let L=0;for(;(L=E.indexOf("../",L))!==-1;)s.push(".."),L+=3;for(L=0;(L=E.indexOf("./",L))!==-1;)(L===0||E[L-1]!==".")&&s.push("."),L+=2;let m=J;for(;m.startsWith("../");)s.push(".."),m=m.slice(3);for(;m.startsWith("./");)s.push("."),m=m.slice(2);if(m===".."){s.push("..");break}else if(m==="."){s.push(".");break}else r=m}p.lastIndex=0}if(s.length===0){const o=l.split(n).filter(Boolean);s.push(...o)}let c=[];for(const o of s)h||g?c.push(...Ut(o,f,a)):f?c.push(...v(o,f,a)):c.push(...z(o,a));return U&&(c=c.map(o=>a.has(o)?o:f&&o===o.toLocaleUpperCase(f)?o[0]+o.slice(1).toLocaleLowerCase(f):o.toUpperCase()===o&&!a.has(o)?o.slice(0,1)+o.slice(1).toLowerCase():o)),c};export{mt as splitByCase};
|
package/dist/case/title-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as n}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as o}from"./split-by-case.js";import i from"./upper-first.js";import{g as h}from"../packem_shared/generate-cache-key-th9N8-CB.js";import{n as f}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const d=new n(1e3);function z(a,e){if(typeof a!="string")return"";const t=e?.cache??!1,l=e?.cacheStore??d;let r;if(t&&(r=h(a,e)),t&&r&&l.has(r))return l.get(r);const c=o(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(s=>{const m=e?.locale?.startsWith("de")?f(s):s;return i(e?.locale?m.toLocaleLowerCase(e.locale):m.toLowerCase(),{locale:e?.locale})}).join(" ");return t&&r&&l.set(r,c),c}export{z as default};
|
package/dist/case/train-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as n}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as i}from"./split-by-case.js";import l from"./upper-first.js";import{g as o}from"../packem_shared/generate-cache-key-th9N8-CB.js";import h from"../packem_shared/joinSegments-9qx7xSy7.js";const f=new n(1e3),C=(a,e)=>{if(typeof a!="string")return"";const t=e?.cache??!1,c=e?.cacheStore??f;let r;if(t&&(r=o(a,e)),t&&r&&c.has(r))return c.get(r);const s=h(i(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(m=>l(m,{locale:e?.locale})),"-");return t&&r&&c.set(r,s),s};export{C as default};
|
package/dist/case/upper-first.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s=(r,t)=>typeof r!="string"||r===""?"":(t?.locale?r[0].toLocaleUpperCase(t.locale):r[0].toUpperCase())+r.slice(1);export{s as default};
|
package/dist/closest-string.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distance as
|
|
1
|
+
import{distance as f}from"./packem_shared/closest-CSX4px2F.js";const h=(o,t,l)=>{if(t.length===0)throw new TypeError("When using closestString(), the possibleWords array must contain at least one word");const{caseSensitive:n,compareFn:r=f}={...l},s=n?o:o.toLowerCase();let c=t[0]??void 0,i=1/0;for(const d of t){const e=d,a=n?r(s,e):r(s,e.toLowerCase());a<i&&(c=e,i=a)}return c};export{h as closestString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distance as
|
|
1
|
+
import{distance as n}from"./packem_shared/closest-CSX4px2F.js";const s=(o,a)=>{const{compareFn:e=n}={...a};if(a?.caseSensitive)return(r,t)=>e(o,r)-e(o,t);const c=o.toLowerCase();return(r,t)=>e(c,r.toLowerCase())-e(c,t.toLowerCase())};export{s as compareSimilarity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const x=(o,e)=>{const n=String(o);if(typeof e!="string")throw new TypeError("Expected character");if(e.length===0)throw new TypeError("Expected non-empty substring");let r=0,t=n.indexOf(e);for(;t!==-1;){r++;const c=t+e.length;if(c<=t)break;t=n.indexOf(e,c)}return r};export{x as countOccurrences};
|
package/dist/direction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r="֑-߿יִ-﷽ﹰ-ﻼ",e="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",o=new RegExp(`^[^${e}]*[${r}]`),s=new RegExp(`^[^${r}]*[${e}]`),c=(n="")=>{const t=n;return o.test(t)?"rtl":s.test(t)?"ltr":"neutral"};export{c as direction};
|