@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.
Files changed (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.md +55 -129
  3. package/README.md +2 -2
  4. package/dist/align-text.js +2 -2
  5. package/dist/case/camel-case.js +1 -1
  6. package/dist/case/capital-case.js +1 -1
  7. package/dist/case/constant-case.js +1 -1
  8. package/dist/case/dot-case.js +1 -1
  9. package/dist/case/flat-case.js +1 -1
  10. package/dist/case/flip-case.js +1 -1
  11. package/dist/case/identify-case.js +1 -1
  12. package/dist/case/index.js +1 -1
  13. package/dist/case/kebab-case.js +1 -1
  14. package/dist/case/lower-first.js +1 -1
  15. package/dist/case/no-case.js +1 -1
  16. package/dist/case/pascal-case.js +1 -1
  17. package/dist/case/pascal-snake-case.js +1 -1
  18. package/dist/case/path-case.js +1 -1
  19. package/dist/case/sentence-case.js +1 -1
  20. package/dist/case/snake-case.js +1 -1
  21. package/dist/case/split-by-case.js +1 -1
  22. package/dist/case/title-case.js +1 -1
  23. package/dist/case/train-case.js +1 -1
  24. package/dist/case/upper-first.js +1 -1
  25. package/dist/closest-string.js +1 -1
  26. package/dist/compare-similarity.js +1 -1
  27. package/dist/count-occurrences.js +1 -1
  28. package/dist/direction.js +1 -1
  29. package/dist/east-asian-width.d.ts +5 -1
  30. package/dist/east-asian-width.js +1 -1
  31. package/dist/excerpt.js +55 -44
  32. package/dist/get-string-truncated-width.js +1 -1
  33. package/dist/indent.d.ts +3 -1
  34. package/dist/indent.js +1 -1
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +1 -1
  37. package/dist/is-fullwidth-code-point.js +1 -1
  38. package/dist/levenshtein.js +1 -1
  39. package/dist/outdent.js +1 -1
  40. package/dist/packem_shared/{_isFullWidth-Dqc3MWgl.js → _isFullWidth-dWWDw5Is.js} +1 -1
  41. package/dist/packem_shared/ansi-state-tracker-BFhXTS-5.js +1 -0
  42. package/dist/packem_shared/closest-CSX4px2F.js +1 -0
  43. package/dist/packem_shared/constants-BGGeBKGT.js +1 -0
  44. package/dist/packem_shared/dedent-CDXp3nZQ.js +1 -0
  45. package/dist/packem_shared/eastAsianWidth-DACe9Ds2.js +1 -0
  46. package/dist/packem_shared/generate-cache-key-th9N8-CB.js +1 -0
  47. package/dist/packem_shared/indent-CY079Qyq.js +1 -0
  48. package/dist/packem_shared/joinSegments-9qx7xSy7.js +1 -0
  49. package/dist/packem_shared/{lru-cache-BtMSrYQJ.js → lru-cache-BD25OaEQ.js} +1 -1
  50. package/dist/packem_shared/normalize-german-eszett-DtW4F-Wg.js +1 -0
  51. package/dist/packem_shared/redent-lctoaAtw.js +1 -0
  52. package/dist/packem_shared/{strip-vt-control-characters-BW1RglLp.js → strip-vt-control-characters-vMeu7uFw.js} +1 -1
  53. package/dist/replace-string.js +1 -1
  54. package/dist/slice.js +1 -1
  55. package/dist/slugify.js +1 -1
  56. package/dist/test/utils.js +10 -10
  57. package/dist/transliterate.js +3 -3
  58. package/dist/truncate.js +1 -1
  59. package/dist/utilities.js +1 -1
  60. package/dist/word-similarity-sort.js +1 -1
  61. package/dist/word-wrap.js +5 -7
  62. package/package.json +1 -1
  63. package/dist/packem_shared/closest-C6YDQs4m.js +0 -1
  64. package/dist/packem_shared/constants-aPzGW29R.js +0 -1
  65. package/dist/packem_shared/dedent-CPjAYUXh.js +0 -1
  66. package/dist/packem_shared/eastAsianWidth-DJV8Kqd-.js +0 -1
  67. package/dist/packem_shared/generate-cache-key-B_0X7MKm.js +0 -1
  68. package/dist/packem_shared/indent-cz8WMI0e.js +0 -1
  69. package/dist/packem_shared/joinSegments-CaHT-45s.js +0 -1
  70. package/dist/packem_shared/normalize-german-eszett-hNMwtGjd.js +0 -1
  71. 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-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,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 +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{a as d}from"../packem_shared/generate-cache-key-B_0X7MKm.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),z=(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{z 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 +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{a as h}from"../packem_shared/generate-cache-key-B_0X7MKm.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=(a,o)=>{if(typeof a!="string")return"";const s=o?.cache??!1,i=o?.cacheStore??u;let r;if(s&&(r=h(a,o)),s&&r&&i.has(r))return i.get(r);const l=p(a,{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 s&&r&&i.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 +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 +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 +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 +1 @@
1
- import{s as m}from"../packem_shared/constants-aPzGW29R.js";import{i as h}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{r as g}from"../packem_shared/strip-vt-control-characters-BW1RglLp.js";import{a as C}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const u=new h(1e3),x=(i,o)=>{if(typeof i!="string"||i.length===0)return"";const r=o?.cache??!1,c=o?.cacheStore??u;let l;if(r&&(l=C(i,o)),r&&l&&c.has(l))return c.get(l);let e=i;o?.stripEmoji&&(e=m(e)),o?.stripAnsi&&(e=g(e));let n="",t=0;for(;t<e.length;){if(o?.handleAnsi&&e[t]==="\x1B"){let p=e[t];for(t+=1;t<e.length&&e[t]!=="m";)p+=e[t],t+=1;t<e.length&&(p+=e[t],n+=p),t+=1;continue}const s=e[t],f=o?.locale?s.toLocaleLowerCase(o.locale):s.toLowerCase();let a;s===f?a=o?.locale?s.toLocaleUpperCase(o.locale):s.toUpperCase():a=f,n+=a,t+=1}return r&&l&&c.set(l,n),n};export{x as flipCase};
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 n=/^([A-Z][a-z]*)+$/,r=/[a-z]/i,a=/^[A-Z0-9_]+$/,i=/^[a-z0-9_]+$/,u=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,l=/^[a-z ]+$/,o=/^[A-Z][A-Z0-9]*$/,p=/\s+/,z=/^\d+$/,c=/^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)+$/,f=/^[a-z]/,$=/[.!?;:,](?!\s|$)/,d=e=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(!e||!r.test(e))return"unknown";if(e.includes("_"))return a.test(e)?"upper_snake":i.test(e)?"snake":"mixed";if(e.includes("-"))return u.test(e)?"kebab":"mixed";if(l.test(e))return"lower";if(o.test(e))return"upper";const t=e.split(p);return t.length>1&&t.every(s=>n.test(s))||t.length>1&&z.test(t[0])&&n.test(t[1])?"title":t.length>1&&n.test(t[0])&&f.test(t[1])?"sentence":n.test(e)?"pascal":c.test(e)?"camel":$.test(e)?"unknown":"mixed"};export{d as default};
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};
@@ -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-CaHT-45s.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};
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};
@@ -1 +1 @@
1
- import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(s,o)=>{if(typeof s!="string")return"";const e=o?.cache??!1,n=o?.cacheStore??d;let r;if(e&&(r=f(s,o)),e&&r&&n.has(r))return n.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(o?.handleAnsi&&c.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?A(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),a=h(l,o?.joiner??"-");return e&&r&&n.set(r,a),a};export{L as kebabCase};
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};
@@ -1 +1 @@
1
- const a=(e,o)=>typeof e!="string"||e===""?"":(o?.locale?e[0].toLocaleLowerCase(o.locale):e[0].toLowerCase())+e.slice(1);export{a as default};
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};
@@ -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),n=(e,o)=>t(e,{cacheStore:r,...o,joiner:" "});export{n as default};
@@ -1 +1 @@
1
- import{c as e}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import p from"./upper-first.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(t,o)=>{if(typeof t!="string"||!t)return"";const a=o?.cache??!1,i=o?.cacheStore??d;let r;if(a&&(r=f(t,o)),a&&r&&i.has(r))return i.get(r);const n=h(c(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&&e.test(s))return s;const l=o?.locale?.startsWith("de")?A(s):s;return p(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}),"");return a&&r&&i.set(r,n),n};export{L 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 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{i as l}from"../packem_shared/lru-cache-BtMSrYQJ.js";import m from"./no-case.js";import n from"./upper-first.js";import{a as p}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const s=new l(1e3),d=(r,t)=>{if(typeof r!="string")return"";const o=t?.cache??!1,c=t?.cacheStore??s;let e;if(o&&(e=p(r,t)),o&&e&&c.has(e))return c.get(e);const f=m(r,{...t,cache:!1}).split(" ").map(i=>n(i,{locale:t?.locale})).join("_");return o&&e&&c.set(e,f),f};export{d as default};
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};
@@ -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 +1 @@
1
- import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as f}from"./split-by-case.js";import h from"./upper-first.js";import{a as A}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import d from"../packem_shared/joinSegments-CaHT-45s.js";import{a as u}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const w=new p(1e3),$=(s,o)=>{if(typeof s!="string")return"";const a=o?.cache??!1,i=o?.cacheStore??w;let r;if(a&&(r=A(s,o)),a&&r&&i.has(r))return i.get(r);let e=!0;const n=d(f(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(o?.handleAnsi&&c.test(t))return t;const l=o?.locale?.startsWith("de")?u(t):t,m=o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase();return e?(e=!1,h(m,o)):m})," ");return a&&r&&i.set(r,n),n};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{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};
@@ -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),n=(e,o)=>t(e,{cacheStore:a,...o,joiner:"_"});export{n 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),n=(e,a)=>t(e,{cacheStore:r,...a,joiner:"_"});export{n as default};
@@ -1 +1 @@
1
- import{b as W,s as v,l as F,c as x,m,n as U,o as b,p as j,q as y,r as $,t as B,u as q,v as G,w as K,x as H,y as V,z as Z,A as Q,B as X,C as tt,D as et,E as st,F as nt,G as lt,H as rt,I as ot,J as at,K as it,L as ht,M as ct,N as ut}from"../packem_shared/constants-aPzGW29R.js";import{i as ft}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{r as pt}from"../packem_shared/strip-vt-control-characters-BW1RglLp.js";const N=new ft(1e3),gt=/[.*+?^${}()|[\]\\]/g,At=t=>{const l=t.join("");if(N.has(l)){const A=N.get(l);return A.lastIndex=0,A}const c=t.map(A=>A.replaceAll(gt,String.raw`\$&`)).join("|"),g=new RegExp(c,"g");return N.set(l,g),g},Et=t=>{const l=[];let c=0,g;for(W.lastIndex=0;(g=W.exec(t))!==null;)g.index>c&&l.push(t.slice(c,g.index)),l.push(g[0]),c=W.lastIndex;return c<t.length&&l.push(t.slice(c)),l.filter(Boolean)},Rt=/[ČŠŽĐ]/i,O=new Uint8Array(128),P=new Uint8Array(128),z=new Uint8Array(128);for(let t=0;t<128;t++)O[t]=t>=65&&t<=90?1:0,P[t]=t>=97&&t<=122?1:0,z[t]=t>=48&&t<=57?1:0;const w=t=>O[t],M=t=>P[t],T=t=>z[t],d=(t,l,c,g,A)=>{if(t.length===0)return[];let f=!1;const C=Object.values(l);for(const r of C)if(r(t[0])){f=!0;break}if(!f&&!c)return[t];const p=[...t],R=[];let s=p[0],o="other";const h=Object.entries(l);for(const r of h){const[n,i]=r;if(i(p[0])){o=n;break}}let e=c&&g?p[0]===p[0].toLocaleUpperCase(g):!1;for(let r=1;r<p.length;r++){const n=p[r];let i="other";for(const E of h){const[L,_]=E;if(_(n)){i=L;break}}const u=c&&g?n===n.toLocaleUpperCase(g):!1;let a=!1;A?a=A(o,i,e,u,n,r,p):(o!==i&&o!=="other"&&i!=="other"&&(a=!0),c&&i!=="other"&&!e&&u&&(a=!0)),a?(R.push(s),s=n):s+=n,o=i,c&&(e=u)}return s&&s.length>0&&R.push(s),R.length>0?R:[t]},Lt=(t,l,c,g)=>{if(c.size===0)return l;for(const A of c)if(t.startsWith(A,l))return g.push(A),l+A.length;return l},D=(t,l=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let c=0;const g=[],A=t.length;for(let f=1;f<A;f++){const C=Lt(t,c,l,g);if(C!==c){c=C,f=c-1;continue}const p=t.codePointAt(f-1),R=t.codePointAt(f),s=p&&p<128&&w(p),o=R&&R<128&&w(R),h=p&&p<128&&M(p),e=p&&p<128&&T(p),r=R&&R<128&&T(R);if(h&&o){g.push(t.slice(c,f)),c=f;continue}if(e&&!r||!e&&r){g.push(t.slice(c,f)),c=f;continue}if(r&&!e){let n=!1,i=!1;if(f+1<A){const u=t.codePointAt(f+1);n=u&&u<128&&w(u),i=u&&u<128&&T(u)}if(!i&&n){g.push(t.slice(c,f),t.slice(f,f+1)),c=f+1;continue}}if(f+1<A){const n=t.codePointAt(f+1),i=n&&n<128&&M(n);if(s&&o&&i){const u=t.slice(c,f+1);l.has(u)||(g.push(t.slice(c,f)),c=f)}}}return c<A&&g.push(t.slice(c)),g.filter(f=>f!=="")},J=(t,l,c)=>{if(t.length===0)return[];const g=t===t.toLocaleUpperCase(l);if(l.startsWith("de")){if(!g&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(l))return[t];const s=[...t],o=s.length,h=[];let e=s[0],r=s[0]===s[0].toLocaleUpperCase(l),n=r,i=r?0:-1;for(let u=1;u<o;u++){const a=s[u],E=a===a.toLocaleUpperCase(l);if(E===r)e+=a;else if(E)e&&e.length>0&&(h.push(e),e=a),n=!0,i=u;else{if(n&&u-i>1){const L=s[u-1],_=e.slice(0,-1);_&&_.length>0&&h.push(_),e=L+a}else e+=a;n=!1,i=-1}r=E}return e&&e.length>0&&h.push(e),h}if(l.startsWith("uk")||l.startsWith("ru")||l.startsWith("bg")||l.startsWith("sr")||l.startsWith("mk")||l.startsWith("be")){if(!m.test(t)&&!U.test(t))return[t];const s=[...t],o=s.length,h=[];let e=s[0];const r=s[0];let n;m.test(r)?n=1:U.test(r)?n=2:n=0;let i=r===r.toLocaleUpperCase(l);for(let a=1;a<o;a++){const E=s[a];let L;m.test(E)?L=1:U.test(E)?L=2:L=0;const _=E===E.toLocaleUpperCase(l);n!==L&&(n===1||n===2)&&(L===1||L===2)||L===n&&!i&&_?(h.push(e),e=E):e+=E,n=L,i=_}e&&e.length>0&&h.push(e);const u=[];for(let a=0;a<h.length;a++)a<h.length-1&&h[a].length===1&&U.test(h[a])&&m.test(h[a+1][0])?(u.push(h[a]+h[a+1]),a+=1):u.push(h[a]);return u}if(l.startsWith("el")){if(!b.test(t)&&!U.test(t))return[t];const s=[];j.lastIndex=0;let o;for(;(o=j.exec(t))!==null;)s.push(o[0]);s.length===0&&s.push(t);const h=[];if(s.length===1){const e=s[0];if(!e||!b.test(e[0])||e.length===1)return[e??t]}for(const e of s){if(!e)continue;if(!b.test(e[0])||e.length===1){h.push(e);continue}const r=e.length;let n=e[0],i=e[0]===e[0].toLocaleUpperCase(l);for(let u=1;u<r;u++){const a=e[u],E=a===a.toLocaleUpperCase(l);!i&&E?(h.push(n),n=a):n+=a,i=E}n&&h.push(n)}return h}if(l.startsWith("ja")||l.startsWith("ko")){const s=l.startsWith("ja"),o=s?{hiragana:e=>q.test(e),kanji:e=>B.test(e),katakana:e=>$.test(e),latin:e=>U.test(e)}:{hangul:e=>G.test(e),latin:e=>U.test(e)},h=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const e=d(t,o,!1,l,(n,i)=>n==="hiragana"&&i==="katakana"||n==="katakana"&&i==="hiragana"||n==="hiragana"&&i==="latin"||n==="katakana"&&i==="latin"||n==="kanji"&&i==="latin"||n==="latin"&&(i==="hiragana"||i==="katakana"||i==="kanji")),r=[];for(const n of e){const i=n;i.length===1&&h.has(i)&&r.length>0?r[r.length-1]=r.at(-1)+i:r.push(i)}return r.length>0?r:[t]}return d(t,o,!1,l,(e,r)=>e==="hangul"&&r==="latin"||e==="latin"&&r==="hangul")}if(l.startsWith("sl")){const s=[...t],o=s.length,h=[];let e=s[0],r=s[0]===s[0].toLocaleUpperCase(l);for(let n=1;n<o;n++){const i=s[n],u=i===i.toLocaleUpperCase(l),a=Rt.test(i),E=n<o-1&&s[n+1]===s[n+1].toLocaleUpperCase(l);!r&&u||a&&E?(h.push(e),e=i,a&&E&&(h.push(e),e="")):e+=i,r=u}return e&&e.length>0&&h.push(e),h}if(l.startsWith("zh"))return d(t,{han:s=>B.test(s),latin:s=>U.test(s)},!1,l);if(["ar","fa","he","ur"].includes(l.split("-")[0])){const s=o=>K.test(o)||H.test(o);return d(t,{latin:o=>U.test(o),rtl:o=>s(o)},!1,l)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(l.split("-")[0])){const s=o=>V.test(o)||Z.test(o)||Q.test(o)||X.test(o)||tt.test(o)||et.test(o)||st.test(o)||nt.test(o)||lt.test(o)||rt.test(o)||ot.test(o)||at.test(o)||it.test(o)||ht.test(o)||ct.test(o)||ut.test(o);return d(t,{indic:o=>s(o),latin:o=>U.test(o)},!1,l)}if(["be","bg","ru","sr","uk"].includes(l))return d(t,{cyrillic:s=>m.test(s),latin:s=>U.test(s)},!0,l);if(["ar","fa","he"].includes(l))return d(t,{latin:s=>U.test(s),rtl:s=>K.test(s)||H.test(s)},!1,l);if(l.startsWith("ko"))return d(t,{hangul:s=>G.test(s),latin:s=>U.test(s)},!1,l);if(l.startsWith("uz")){if(!m.test(t)&&!U.test(t))return[t];const s=[...t],o=s.length,h=[];let e=s[0],r=s[0]===s[0].toLocaleUpperCase(l);for(let n=1;n<o;n++){const i=s[n],u=i===i.toLocaleUpperCase(l);if(y.test(i)||y.test(s[n-1])){e+=i;continue}!r&&u?(h.push(e),e=i):e+=i,r=u}return e&&e.length>0&&h.push(e),h}const A=[...t],f=A.length,C=[];let p=A[0],R=A[0]===A[0].toLocaleUpperCase(l);for(const s of c)if(t.startsWith(s)){C.push(s),p=A[s.length],R=p===p.toLocaleUpperCase(l);break}for(let s=1;s<f;s++){const o=A[s],h=o===o.toLocaleUpperCase(l);let e=0;for(const r of c)if(t.startsWith(r,s)){C.push(p,r),e=r.length,p="";const n=r.at(-1);n&&(R=n===n.toLocaleUpperCase(l));break}if(e>0){s+=e-1;continue}!R&&h?(C.push(p),p=o):p+=o,R=h}return p&&C.push(p),C},Ct=(t,l,c)=>{const g=[],A=x.test(t)?t.split(x).filter(Boolean):[t];for(const f of A){const C=f;if(x.test(C))g.push(C);else{W.lastIndex=0;const p=W.test(C)?Et(C).filter(Boolean):[C];for(const R of p)if(W.lastIndex=0,W.test(R))g.push(R);else if(l){const s=l.toLowerCase().split("-")[0];g.push(...J(R,s,c))}else g.push(...D(R,c))}}return g},kt=(t,l={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:c=!1,handleEmoji:g=!1,knownAcronyms:A=[],locale:f,normalize:C=!1,separators:p,stripAnsi:R=!1,stripEmoji:s=!1}=l,o=new Set([...A].toSorted((a,E)=>E.length-a.length));let h=t;R&&(h=pt(h)),s&&(h=v(h));let e;Array.isArray(p)?e=At(p):p instanceof RegExp?e=p:e=F;const r=[];let n=h;const i=e.flags.includes("g")?e:new RegExp(e.source,`${e.flags}g`);for(;n.length>0;){const a=i.exec(n);if(!a){n===".."?r.push(".."):n==="."?r.push("."):n.length>0&&r.push(n);break}const E=a.index,L=a[0],_=L.length,S=n.slice(0,E),Y=n.slice(E+_);if(L.startsWith("../"))r.push(".."),n=n.slice(E+3);else if(L.startsWith("./"))r.push("."),n=n.slice(E+2);else if(E===0&&L==="..")r.push(".."),n=n.slice(2);else if(E===0&&L===".")r.push("."),n=n.slice(1);else{S.length>0&&r.push(S);let I=0;for(;(I=L.indexOf("../",I))!==-1;)r.push(".."),I+=3;for(I=0;(I=L.indexOf("./",I))!==-1;)(I===0||L[I-1]!==".")&&r.push("."),I+=2;let k=Y;for(;k.startsWith("../");)r.push(".."),k=k.slice(3);for(;k.startsWith("./");)r.push("."),k=k.slice(2);if(k===".."){r.push("..");break}else if(k==="."){r.push(".");break}else n=k}i.lastIndex=0}if(r.length===0){const a=h.split(e).filter(Boolean);r.push(...a)}let u=[];for(const a of r)c||g?u.push(...Ct(a,f,o)):f?u.push(...J(a,f,o)):u.push(...D(a,o));return C&&(u=u.map(a=>o.has(a)?a:f&&a===a.toLocaleUpperCase(f)?a[0]+a.slice(1).toLocaleLowerCase(f):a.toUpperCase()===a&&!o.has(a)?a.slice(0,1)+a.slice(1).toLowerCase():a)),u};export{kt as splitByCase};
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};
@@ -1 +1 @@
1
- import{i as e}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import m from"./upper-first.js";import{a as p}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import{a as f}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new e(1e3);function y(a,o){if(typeof a!="string")return"";const t=o?.cache??!1,s=o?.cacheStore??d;let r;if(t&&(r=p(a,o)),t&&r&&s.has(r))return s.get(r);const i=c(a,{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(n=>{const l=o?.locale?.startsWith("de")?f(n):n;return m(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}).join(" ");return t&&r&&s.set(r,i),i}export{y as default};
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};
@@ -1 +1 @@
1
- import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as l}from"./split-by-case.js";import e from"./upper-first.js";import{a as p}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import c from"../packem_shared/joinSegments-CaHT-45s.js";const f=new m(1e3),y=(t,o)=>{if(typeof t!="string")return"";const i=o?.cache??!1,n=o?.cacheStore??f;let r;if(i&&(r=p(t,o)),i&&r&&n.has(r))return n.get(r);const s=c(l(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(a=>e(a,{locale:o?.locale})),"-");return i&&r&&n.set(r,s),s};export{y as default};
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};
@@ -1 +1 @@
1
- const a=(e,o)=>typeof e!="string"||e===""?"":(o?.locale?e[0].toLocaleUpperCase(o.locale):e[0].toUpperCase())+e.slice(1);export{a as default};
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};
@@ -1 +1 @@
1
- import{distance as p}from"./packem_shared/closest-C6YDQs4m.js";const d=(s,o,l)=>{if(o.length===0)throw new TypeError("When using closestString(), the possibleWords array must contain at least one word");const{caseSensitive:e,compareFn:r=p}={...l},n=e?s:s.toLowerCase();let a=o[0]??void 0,i=1/0;for(const g of o){const t=g,c=e?r(n,t):r(n,t.toLowerCase());c<i&&(a=t,i=c)}return a};export{d as closestString};
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 i}from"./packem_shared/closest-C6YDQs4m.js";const n=(o,s)=>{const{compareFn:e=i}={...s};if(s?.caseSensitive)return(t,r)=>e(o,t)-e(o,r);const a=o.toLowerCase();return(t,r)=>e(a,t.toLowerCase())-e(a,r.toLowerCase())};export{n as compareSimilarity};
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 i=(c,r)=>{const n=String(c);if(typeof r!="string")throw new TypeError("Expected character");if(r.length===0)throw new TypeError("Expected non-empty substring");let e=0,t=n.indexOf(r);for(;t!==-1;){e++;const o=t+r.length;if(o<=t)break;t=n.indexOf(r,o)}return e};export{i as countOccurrences};
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 e="֑-߿יִ-﷽ﹰ-ﻼ",n="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",o=new RegExp(`^[^${n}]*[${e}]`),s=new RegExp(`^[^${e}]*[${n}]`),c=(r="")=>{const t=r;return o.test(t)?"rtl":s.test(t)?"ltr":"neutral"};export{c as direction};
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};