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