@visulima/string 1.2.2 → 1.3.0

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 (196) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +46 -0
  4. package/dist/case/camel-case.cjs +1 -59
  5. package/dist/case/camel-case.d.cts +2 -2
  6. package/dist/case/camel-case.d.mts +2 -2
  7. package/dist/case/camel-case.d.ts +2 -2
  8. package/dist/case/camel-case.mjs +1 -57
  9. package/dist/case/capital-case.cjs +1 -51
  10. package/dist/case/capital-case.d.cts +2 -2
  11. package/dist/case/capital-case.d.mts +2 -2
  12. package/dist/case/capital-case.d.ts +2 -2
  13. package/dist/case/capital-case.mjs +1 -49
  14. package/dist/case/constant-case.cjs +1 -11
  15. package/dist/case/constant-case.d.cts +2 -2
  16. package/dist/case/constant-case.d.mts +2 -2
  17. package/dist/case/constant-case.d.ts +2 -2
  18. package/dist/case/constant-case.mjs +1 -9
  19. package/dist/case/dot-case.cjs +1 -11
  20. package/dist/case/dot-case.d.cts +2 -2
  21. package/dist/case/dot-case.d.mts +2 -2
  22. package/dist/case/dot-case.d.ts +2 -2
  23. package/dist/case/dot-case.mjs +1 -9
  24. package/dist/case/flat-case.cjs +1 -11
  25. package/dist/case/flat-case.d.cts +2 -2
  26. package/dist/case/flat-case.d.mts +2 -2
  27. package/dist/case/flat-case.d.ts +2 -2
  28. package/dist/case/flat-case.mjs +1 -9
  29. package/dist/case/flip-case.cjs +1 -61
  30. package/dist/case/flip-case.d.cts +4 -3
  31. package/dist/case/flip-case.d.mts +4 -3
  32. package/dist/case/flip-case.d.ts +4 -3
  33. package/dist/case/flip-case.mjs +1 -57
  34. package/dist/case/identify-case.cjs +1 -69
  35. package/dist/case/identify-case.d.cts +2 -2
  36. package/dist/case/identify-case.d.mts +2 -2
  37. package/dist/case/identify-case.d.ts +2 -2
  38. package/dist/case/identify-case.mjs +1 -67
  39. package/dist/case/index.cjs +1 -47
  40. package/dist/case/index.d.cts +2 -2
  41. package/dist/case/index.d.mts +2 -2
  42. package/dist/case/index.d.ts +2 -2
  43. package/dist/case/index.mjs +1 -20
  44. package/dist/case/kebab-case.cjs +1 -61
  45. package/dist/case/kebab-case.d.cts +4 -3
  46. package/dist/case/kebab-case.d.mts +4 -3
  47. package/dist/case/kebab-case.d.ts +4 -3
  48. package/dist/case/kebab-case.mjs +1 -57
  49. package/dist/case/lower-first.cjs +1 -13
  50. package/dist/case/lower-first.d.cts +2 -2
  51. package/dist/case/lower-first.d.mts +2 -2
  52. package/dist/case/lower-first.d.ts +2 -2
  53. package/dist/case/lower-first.mjs +1 -11
  54. package/dist/case/no-case.cjs +1 -11
  55. package/dist/case/no-case.d.cts +2 -2
  56. package/dist/case/no-case.d.mts +2 -2
  57. package/dist/case/no-case.d.ts +2 -2
  58. package/dist/case/no-case.mjs +1 -9
  59. package/dist/case/pascal-case.cjs +1 -52
  60. package/dist/case/pascal-case.d.cts +2 -2
  61. package/dist/case/pascal-case.d.mts +2 -2
  62. package/dist/case/pascal-case.d.ts +2 -2
  63. package/dist/case/pascal-case.mjs +1 -50
  64. package/dist/case/pascal-snake-case.cjs +1 -32
  65. package/dist/case/pascal-snake-case.d.cts +2 -2
  66. package/dist/case/pascal-snake-case.d.mts +2 -2
  67. package/dist/case/pascal-snake-case.d.ts +2 -2
  68. package/dist/case/pascal-snake-case.mjs +1 -30
  69. package/dist/case/path-case.cjs +1 -11
  70. package/dist/case/path-case.d.cts +2 -2
  71. package/dist/case/path-case.d.mts +2 -2
  72. package/dist/case/path-case.d.ts +2 -2
  73. package/dist/case/path-case.mjs +1 -9
  74. package/dist/case/sentence-case.cjs +1 -58
  75. package/dist/case/sentence-case.d.cts +2 -2
  76. package/dist/case/sentence-case.d.mts +2 -2
  77. package/dist/case/sentence-case.d.ts +2 -2
  78. package/dist/case/sentence-case.mjs +1 -56
  79. package/dist/case/snake-case.cjs +1 -11
  80. package/dist/case/snake-case.d.cts +2 -2
  81. package/dist/case/snake-case.d.mts +2 -2
  82. package/dist/case/snake-case.d.ts +2 -2
  83. package/dist/case/snake-case.mjs +1 -9
  84. package/dist/case/split-by-case.cjs +1 -641
  85. package/dist/case/split-by-case.d.cts +4 -3
  86. package/dist/case/split-by-case.d.mts +4 -3
  87. package/dist/case/split-by-case.d.ts +4 -3
  88. package/dist/case/split-by-case.mjs +1 -637
  89. package/dist/case/title-case.cjs +1 -47
  90. package/dist/case/title-case.d.cts +2 -2
  91. package/dist/case/title-case.d.mts +2 -2
  92. package/dist/case/title-case.d.ts +2 -2
  93. package/dist/case/title-case.mjs +1 -45
  94. package/dist/case/train-case.cjs +1 -44
  95. package/dist/case/train-case.d.cts +2 -2
  96. package/dist/case/train-case.d.mts +2 -2
  97. package/dist/case/train-case.d.ts +2 -2
  98. package/dist/case/train-case.mjs +1 -42
  99. package/dist/case/upper-first.cjs +1 -13
  100. package/dist/case/upper-first.d.cts +2 -2
  101. package/dist/case/upper-first.d.mts +2 -2
  102. package/dist/case/upper-first.d.ts +2 -2
  103. package/dist/case/upper-first.mjs +1 -11
  104. package/dist/get-string-truncated-width.cjs +1 -422
  105. package/dist/get-string-truncated-width.d.cts +2 -1
  106. package/dist/get-string-truncated-width.d.mts +2 -1
  107. package/dist/get-string-truncated-width.d.ts +2 -1
  108. package/dist/get-string-truncated-width.mjs +1 -418
  109. package/dist/get-string-width.cjs +1 -11
  110. package/dist/get-string-width.d.cts +2 -1
  111. package/dist/get-string-width.d.mts +2 -1
  112. package/dist/get-string-width.d.ts +2 -1
  113. package/dist/get-string-width.mjs +1 -7
  114. package/dist/index.cjs +1 -66
  115. package/dist/index.d.cts +15 -5
  116. package/dist/index.d.mts +15 -5
  117. package/dist/index.d.ts +15 -5
  118. package/dist/index.mjs +1 -29
  119. package/dist/native-string-types.d.cts +1 -1
  120. package/dist/native-string-types.d.mts +1 -1
  121. package/dist/native-string-types.d.ts +1 -1
  122. package/dist/outdent.cjs +1 -125
  123. package/dist/outdent.d.cts +2 -1
  124. package/dist/outdent.d.mts +2 -1
  125. package/dist/outdent.d.ts +2 -1
  126. package/dist/outdent.mjs +1 -121
  127. package/dist/packem_shared/LRUCache-Bjo6gsbC.mjs +1 -0
  128. package/dist/packem_shared/LRUCache-TYqfUYE5.cjs +1 -0
  129. package/dist/packem_shared/WrapMode-BL2dnSc8.cjs +8 -0
  130. package/dist/packem_shared/WrapMode-DxH5g69E.mjs +8 -0
  131. package/dist/packem_shared/alignText-BCKbnqhC.mjs +2 -0
  132. package/dist/packem_shared/alignText-CLZJuPP6.cjs +2 -0
  133. package/dist/packem_shared/constants-Cd17VNEv.mjs +1 -0
  134. package/dist/packem_shared/constants-D3K8u3G8.cjs +1 -0
  135. package/dist/packem_shared/generate-cache-key-BZf0GiMs.cjs +1 -0
  136. package/dist/packem_shared/generate-cache-key-DPByFaMH.mjs +1 -0
  137. package/dist/packem_shared/joinSegments-CDHNMXsF.cjs +1 -0
  138. package/dist/packem_shared/joinSegments-H7QJ7rwJ.mjs +1 -0
  139. package/dist/packem_shared/normalize-german-eszett-4k1qRtEP.mjs +1 -0
  140. package/dist/packem_shared/normalize-german-eszett-Bop4wOp9.cjs +1 -0
  141. package/dist/packem_shared/replaceString-Ce8TI_-L.cjs +1 -0
  142. package/dist/packem_shared/replaceString-D7R-5VFX.mjs +1 -0
  143. package/dist/packem_shared/slugify-B1vlQQO1.mjs +1 -0
  144. package/dist/packem_shared/slugify-CH3GI7E5.cjs +1 -0
  145. package/dist/packem_shared/transliterate-BXaP38Sh.mjs +5 -0
  146. package/dist/packem_shared/transliterate-CToQ-aeM.cjs +5 -0
  147. package/dist/packem_shared/{types-DmfKbIaI.d.ts → types-BSdIWVzn.d.cts} +2 -1
  148. package/dist/packem_shared/{types-DmfKbIaI.d.cts → types-BSdIWVzn.d.mts} +2 -1
  149. package/dist/packem_shared/{types-DmfKbIaI.d.mts → types-BSdIWVzn.d.ts} +2 -1
  150. package/dist/packem_shared/{types-DcGtApe2.d.ts → types-BfGNLD2K.d.ts} +1 -1
  151. package/dist/packem_shared/{types-C5Pk8B8Q.d.cts → types-DrtiqNkK.d.cts} +1 -1
  152. package/dist/packem_shared/{types-_jqW_ZOt.d.mts → types-mlwFVBiS.d.mts} +1 -1
  153. package/dist/slice.cjs +1 -419
  154. package/dist/slice.d.cts +2 -1
  155. package/dist/slice.d.mts +2 -1
  156. package/dist/slice.d.ts +2 -1
  157. package/dist/slice.mjs +1 -415
  158. package/dist/test/utils.cjs +13 -74
  159. package/dist/test/utils.d.cts +2 -1
  160. package/dist/test/utils.d.mts +2 -1
  161. package/dist/test/utils.d.ts +2 -1
  162. package/dist/test/utils.mjs +14 -69
  163. package/dist/test/vitest.cjs +1 -11
  164. package/dist/test/vitest.d.cts +2 -1
  165. package/dist/test/vitest.d.mts +2 -1
  166. package/dist/test/vitest.d.ts +2 -1
  167. package/dist/test/vitest.mjs +1 -7
  168. package/dist/truncate.cjs +1 -101
  169. package/dist/truncate.d.cts +2 -1
  170. package/dist/truncate.d.mts +2 -1
  171. package/dist/truncate.d.ts +2 -1
  172. package/dist/truncate.mjs +1 -97
  173. package/dist/utils.cjs +1 -65
  174. package/dist/utils.d.cts +1 -1
  175. package/dist/utils.d.mts +1 -1
  176. package/dist/utils.d.ts +1 -1
  177. package/dist/utils.mjs +1 -56
  178. package/package.json +9 -6
  179. package/dist/packem_shared/LRUCache-Crb-m7cw.cjs +0 -53
  180. package/dist/packem_shared/LRUCache-udNErhWw.mjs +0 -51
  181. package/dist/packem_shared/WrapMode-B-WBY1mj.mjs +0 -545
  182. package/dist/packem_shared/WrapMode-Dsqu9BaX.cjs +0 -550
  183. package/dist/packem_shared/constants-CKuHriHc.cjs +0 -151
  184. package/dist/packem_shared/constants-CsGLUb4U.mjs +0 -100
  185. package/dist/packem_shared/generate-cache-key-D8f1auDB.cjs +0 -10
  186. package/dist/packem_shared/generate-cache-key-YSju5pj2.mjs +0 -8
  187. package/dist/packem_shared/joinSegments-B_7bxy5J.cjs +0 -48
  188. package/dist/packem_shared/joinSegments-BovQ2h_P.mjs +0 -46
  189. package/dist/packem_shared/normalize-german-eszett-DJK0S2qj.cjs +0 -11
  190. package/dist/packem_shared/normalize-german-eszett-fpJ4lZL6.mjs +0 -9
  191. package/dist/packem_shared/replaceString-C7Dp5vAg.mjs +0 -200
  192. package/dist/packem_shared/replaceString-iYo1cDfZ.cjs +0 -202
  193. package/dist/packem_shared/slugify-DhE59J2A.mjs +0 -48
  194. package/dist/packem_shared/slugify-jh6PftAT.cjs +0 -50
  195. package/dist/packem_shared/transliterate-BEci5RC8.cjs +0 -47782
  196. package/dist/packem_shared/transliterate-DwSldp0o.mjs +0 -47780
package/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## @visulima/string [1.3.0](https://github.com/visulima/visulima/compare/@visulima/string@1.2.3...@visulima/string@1.3.0) (2025-05-31)
2
+
3
+ ### Features
4
+
5
+ * **string:** add alignText function for text alignment and create unit tests ([688d1c4](https://github.com/visulima/visulima/commit/688d1c4056f9ef93484f9780c02b83b4507241f7))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * **string:** update package.json to add new alignment keywords and modify build scripts ([03365cf](https://github.com/visulima/visulima/commit/03365cf3b1b533e9e0ba497b8e278b8065f7bca7))
10
+ * **string:** updated readme ([54dd1ff](https://github.com/visulima/visulima/commit/54dd1ff16a13bf1ed100b46b7c8628cbca152d96))
11
+
12
+ ## @visulima/string [1.2.3](https://github.com/visulima/visulima/compare/@visulima/string@1.2.2...@visulima/string@1.2.3) (2025-05-30)
13
+
14
+ ### Bug Fixes
15
+
16
+ * **string:** move postinstall scrip into a command ([af74390](https://github.com/visulima/visulima/commit/af743905042ece78028b2e2b1205898e4d8fc72d))
17
+ * **string:** update dependencies ([f19d726](https://github.com/visulima/visulima/commit/f19d7267f689c9e45064aacdd19033c19e9c3a5a))
18
+
19
+ ### Styles
20
+
21
+ * cs fixes ([6570d56](https://github.com/visulima/visulima/commit/6570d568a80bd3fd4bfd73c824dc78f7e3a372f8))
22
+
23
+ ### Miscellaneous Chores
24
+
25
+ * **string-bench:** update devDependencies ([e316f82](https://github.com/visulima/visulima/commit/e316f829b2e0917138cca678ecd2094fe7f8d532))
26
+ * **string:** update dependencies in package.json and adjust test cases for string width calculations ([96b28e4](https://github.com/visulima/visulima/commit/96b28e46eb977b5f11be0adf13116ef318fea022))
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * **@visulima/colorize:** upgraded to 1.4.22
32
+
1
33
  ## @visulima/string [1.2.2](https://github.com/visulima/visulima/compare/@visulima/string@1.2.1...@visulima/string@1.2.2) (2025-05-07)
2
34
 
3
35
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -34,7 +34,7 @@ Repository: git+https://github.com/slevithan/emoji-regex-xs.git
34
34
 
35
35
  > MIT License
36
36
  >
37
- > Copyright (c) 2024 Steven Levithan
37
+ > Copyright (c) 2025 Steven Levithan
38
38
  >
39
39
  > Permission is hereby granted, free of charge, to any person obtaining a copy
40
40
  > of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1032,6 +1032,52 @@ slugify("Keep C++", { replaceBefore: { "C++": "cpp" } }); // 'keep-cpp'
1032
1032
  slugify("Keep !@#$", { allowedChars: "a-z!@$" }); // 'keep!@$'
1033
1033
  ```
1034
1034
 
1035
+ ### Text Alignment
1036
+
1037
+ The `alignText` function aligns text (including multi-line strings and strings with ANSI escape codes) to the left, center, or right. It can handle both single strings (which can be split into lines based on the `split` option) and arrays of strings.
1038
+
1039
+ ```typescript
1040
+ import { alignText } from "@visulima/string";
1041
+ // For type information, you might also import:
1042
+ // import type { AlignTextOptions, StringWidthOptions } from "@visulima/string";
1043
+
1044
+ // Example 1: Aligning a single multi-line string to the right
1045
+ const text1 = "First line\nSecond, much longer line";
1046
+ const alignedText1 = alignText(text1, { align: "right" });
1047
+ // alignedText1 (string output, exact padding depends on calculated widths):
1048
+ // " First line\nSecond, much longer line"
1049
+
1050
+ // Example 2: Aligning an array of strings to the center
1051
+ const textArray = ["Short", "Medium length", "A very very long line indeed"];
1052
+ const alignedArray = alignText(textArray, { align: "center" });
1053
+ // alignedArray (array output, exact padding depends on calculated widths):
1054
+ // [
1055
+ // " Short ",
1056
+ // " Medium length ",
1057
+ // "A very very long line indeed"
1058
+ // ]
1059
+
1060
+ // Example 3: Custom padding, split, and stringWidthOptions for emojis
1061
+ const emojiText = "Line1😊*WiderLine😊😊";
1062
+ const alignedEmojiText = alignText(emojiText, {
1063
+ align: "center",
1064
+ split: "*",
1065
+ pad: "-",
1066
+ stringWidthOptions: { emojiWidth: 2 } // Crucial for correct width calculation with emojis
1067
+ });
1068
+ // alignedEmojiText (string output, exact padding depends on calculated widths):
1069
+ // "--Line1😊---\nWiderLine😊😊"
1070
+ ```
1071
+
1072
+ #### Alignment Options
1073
+
1074
+ The `alignText` function accepts an `options` object of type `AlignTextOptions` with the following properties:
1075
+
1076
+ - `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.
1077
+ - `pad?: string`: The character or string to use for padding. Defaults to `" "`.
1078
+ - `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"`.
1079
+ - `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
+
1035
1081
  ## Related
1036
1082
 
1037
1083
  - [change-case](https://github.com/blakeembrey/change-case) - Simple string case utilities
@@ -1,59 +1 @@
1
- 'use strict';
2
-
3
- const constants = require('../packem_shared/constants-CKuHriHc.cjs');
4
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
5
- const case_lowerFirst = require('./lower-first.cjs');
6
- const case_splitByCase = require('./split-by-case.cjs');
7
- const case_upperFirst = require('./upper-first.cjs');
8
- const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
9
- const joinSegments = require('../packem_shared/joinSegments-B_7bxy5J.cjs');
10
- const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
11
-
12
- var __defProp = Object.defineProperty;
13
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
14
- const defaultCacheStore = new LRUCache(1e3);
15
- const camelCase = /* @__PURE__ */ __name((value, options) => {
16
- if (typeof value !== "string" || !value) {
17
- return "";
18
- }
19
- const shouldCache = options?.cache ?? false;
20
- const cacheStore = options?.cacheStore ?? defaultCacheStore;
21
- let cacheKey;
22
- if (shouldCache) {
23
- cacheKey = generateCacheKey.generateCacheKey(value, options);
24
- }
25
- if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
26
- return cacheStore.get(cacheKey);
27
- }
28
- let firstWord = true;
29
- const result = joinSegments(
30
- case_splitByCase.splitByCase(value, {
31
- handleAnsi: options?.handleAnsi,
32
- handleEmoji: options?.handleEmoji,
33
- knownAcronyms: options?.knownAcronyms,
34
- locale: options?.locale,
35
- normalize: options?.normalize,
36
- separators: void 0,
37
- stripAnsi: options?.stripAnsi,
38
- stripEmoji: options?.stripEmoji
39
- }).map((word) => {
40
- if (options?.handleAnsi && constants.RE_FAST_ANSI.test(word)) {
41
- return word;
42
- }
43
- word = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
44
- word = options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase();
45
- if (firstWord) {
46
- firstWord = false;
47
- return case_lowerFirst(word, options);
48
- }
49
- return case_upperFirst(word, options);
50
- }),
51
- ""
52
- );
53
- if (shouldCache && cacheKey) {
54
- cacheStore.set(cacheKey, result);
55
- }
56
- return result;
57
- }, "camelCase");
58
-
59
- module.exports = camelCase;
1
+ "use strict";var c=Object.defineProperty;var l=(a,e)=>c(a,"name",{value:e,configurable:!0});const u=require("../packem_shared/constants-D3K8u3G8.cjs"),m=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),p=require("./lower-first.cjs"),h=require("./split-by-case.cjs"),d=require("./upper-first.cjs"),q=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),y=require("../packem_shared/joinSegments-CDHNMXsF.cjs"),f=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var A=Object.defineProperty,C=l((a,e)=>A(a,"name",{value:e,configurable:!0}),"l");const j=new m(1e3),w=C((a,e)=>{if(typeof a!="string"||!a)return"";const t=e?.cache??!1,i=e?.cacheStore??j;let r;if(t&&(r=q.a(a,e)),t&&r&&i.has(r))return i.get(r);let n=!0;const o=y(h.splitByCase(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=>e?.handleAnsi&&u.R.test(s)?s:(s=e?.locale?.startsWith("de")?f.l(s):s,s=e?.locale?s.toLocaleLowerCase(e.locale):s.toLowerCase(),n?(n=!1,p(s,e)):d(s,e))),"");return t&&r&&i.set(r,o),o},"camelCase");module.exports=w;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-_jqW_ZOt.mjs';
2
- import '../packem_shared/types-DmfKbIaI.mjs';
1
+ import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-mlwFVBiS.mjs';
2
+ import '../packem_shared/types-BSdIWVzn.mjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.mjs';
4
4
 
5
5
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-DcGtApe2.js';
2
- import '../packem_shared/types-DmfKbIaI.js';
1
+ import { C as CaseOptions, a as CamelCase } from '../packem_shared/types-BfGNLD2K.js';
2
+ import '../packem_shared/types-BSdIWVzn.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
@@ -1,57 +1 @@
1
- import { R as RE_FAST_ANSI } from '../packem_shared/constants-CsGLUb4U.mjs';
2
- import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
3
- import lowerFirst from './lower-first.mjs';
4
- import { splitByCase } from './split-by-case.mjs';
5
- import upperFirst from './upper-first.mjs';
6
- import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
7
- import joinSegments from '../packem_shared/joinSegments-BovQ2h_P.mjs';
8
- import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
9
-
10
- var __defProp = Object.defineProperty;
11
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
12
- const defaultCacheStore = new LRUCache(1e3);
13
- const camelCase = /* @__PURE__ */ __name((value, options) => {
14
- if (typeof value !== "string" || !value) {
15
- return "";
16
- }
17
- const shouldCache = options?.cache ?? false;
18
- const cacheStore = options?.cacheStore ?? defaultCacheStore;
19
- let cacheKey;
20
- if (shouldCache) {
21
- cacheKey = generateCacheKey(value, options);
22
- }
23
- if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
24
- return cacheStore.get(cacheKey);
25
- }
26
- let firstWord = true;
27
- const result = joinSegments(
28
- splitByCase(value, {
29
- handleAnsi: options?.handleAnsi,
30
- handleEmoji: options?.handleEmoji,
31
- knownAcronyms: options?.knownAcronyms,
32
- locale: options?.locale,
33
- normalize: options?.normalize,
34
- separators: void 0,
35
- stripAnsi: options?.stripAnsi,
36
- stripEmoji: options?.stripEmoji
37
- }).map((word) => {
38
- if (options?.handleAnsi && RE_FAST_ANSI.test(word)) {
39
- return word;
40
- }
41
- word = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
42
- word = options?.locale ? word.toLocaleLowerCase(options.locale) : word.toLowerCase();
43
- if (firstWord) {
44
- firstWord = false;
45
- return lowerFirst(word, options);
46
- }
47
- return upperFirst(word, options);
48
- }),
49
- ""
50
- );
51
- if (shouldCache && cacheKey) {
52
- cacheStore.set(cacheKey, result);
53
- }
54
- return result;
55
- }, "camelCase");
56
-
57
- export { camelCase as default };
1
+ var m=Object.defineProperty;var n=(t,o)=>m(t,"name",{value:o,configurable:!0});import{R as c}from"../packem_shared/constants-Cd17VNEv.mjs";import p from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import f from"./lower-first.mjs";import{splitByCase as d}from"./split-by-case.mjs";import h from"./upper-first.mjs";import{a as A}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import u from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";import{l as y}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var j=Object.defineProperty,w=n((t,o)=>j(t,"name",{value:o,configurable:!0}),"l");const E=new p(1e3),R=w((t,o)=>{if(typeof t!="string"||!t)return"";const e=o?.cache??!1,s=o?.cacheStore??E;let r;if(e&&(r=A(t,o)),e&&r&&s.has(r))return s.get(r);let i=!0;const l=u(d(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=>o?.handleAnsi&&c.test(a)?a:(a=o?.locale?.startsWith("de")?y(a):a,a=o?.locale?a.toLocaleLowerCase(o.locale):a.toLowerCase(),i?(i=!1,f(a,o)):h(a,o))),"");return e&&r&&s.set(r,l),l},"camelCase");export{R as default};
@@ -1,51 +1 @@
1
- 'use strict';
2
-
3
- const constants = require('../packem_shared/constants-CKuHriHc.cjs');
4
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
5
- const case_splitByCase = require('./split-by-case.cjs');
6
- const case_upperFirst = require('./upper-first.cjs');
7
- const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
8
- const joinSegments = require('../packem_shared/joinSegments-B_7bxy5J.cjs');
9
- const normalizeGermanEszett = require('../packem_shared/normalize-german-eszett-DJK0S2qj.cjs');
10
-
11
- var __defProp = Object.defineProperty;
12
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
13
- const defaultCacheStore = new LRUCache(1e3);
14
- const capitalCase = /* @__PURE__ */ __name((value, options) => {
15
- if (typeof value !== "string") {
16
- return "";
17
- }
18
- const shouldCache = options?.cache ?? false;
19
- const cacheStore = options?.cacheStore ?? defaultCacheStore;
20
- let cacheKey;
21
- if (shouldCache) {
22
- cacheKey = generateCacheKey.generateCacheKey(value, options);
23
- }
24
- if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
25
- return cacheStore.get(cacheKey);
26
- }
27
- const words = case_splitByCase.splitByCase(value, {
28
- handleAnsi: options?.handleAnsi,
29
- handleEmoji: options?.handleEmoji,
30
- knownAcronyms: options?.knownAcronyms,
31
- locale: options?.locale,
32
- normalize: options?.normalize,
33
- separators: void 0,
34
- stripAnsi: options?.stripAnsi,
35
- stripEmoji: options?.stripEmoji
36
- });
37
- const processed = words.map((word) => {
38
- if (constants.RE_FAST_ANSI.test(word)) {
39
- return word;
40
- }
41
- const split = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
42
- return case_upperFirst(options?.locale ? split.toLocaleLowerCase(options.locale) : split.toLocaleLowerCase(), options);
43
- });
44
- const result = joinSegments(processed, " ");
45
- if (shouldCache && cacheKey) {
46
- cacheStore.set(cacheKey, result);
47
- }
48
- return result;
49
- }, "capitalCase");
50
-
51
- module.exports = capitalCase;
1
+ "use strict";var u=Object.defineProperty;var c=(r,e)=>u(r,"name",{value:e,configurable:!0});const m=require("../packem_shared/constants-D3K8u3G8.cjs"),p=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),h=require("./split-by-case.cjs"),y=require("./upper-first.cjs"),d=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs"),f=require("../packem_shared/joinSegments-CDHNMXsF.cjs"),q=require("../packem_shared/normalize-german-eszett-Bop4wOp9.cjs");var A=Object.defineProperty,C=c((r,e)=>A(r,"name",{value:e,configurable:!0}),"l");const j=new p(1e3),g=C((r,e)=>{if(typeof r!="string")return"";const t=e?.cache??!1,n=e?.cacheStore??j;let a;if(t&&(a=d.a(r,e)),t&&a&&n.has(a))return n.get(a);const l=h.splitByCase(r,{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=>{if(m.R.test(s))return s;const o=e?.locale?.startsWith("de")?q.l(s):s;return y(e?.locale?o.toLocaleLowerCase(e.locale):o.toLocaleLowerCase(),e)}),i=f(l," ");return t&&a&&n.set(a,i),i},"capitalCase");module.exports=g;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-_jqW_ZOt.mjs';
2
- import '../packem_shared/types-DmfKbIaI.mjs';
1
+ import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-mlwFVBiS.mjs';
2
+ import '../packem_shared/types-BSdIWVzn.mjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.mjs';
4
4
 
5
5
  declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-DcGtApe2.js';
2
- import '../packem_shared/types-DmfKbIaI.js';
1
+ import { C as CaseOptions, b as CapitalCase } from '../packem_shared/types-BfGNLD2K.js';
2
+ import '../packem_shared/types-BSdIWVzn.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,49 +1 @@
1
- import { R as RE_FAST_ANSI } from '../packem_shared/constants-CsGLUb4U.mjs';
2
- import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
3
- import { splitByCase } from './split-by-case.mjs';
4
- import upperFirst from './upper-first.mjs';
5
- import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
6
- import joinSegments from '../packem_shared/joinSegments-BovQ2h_P.mjs';
7
- import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
8
-
9
- var __defProp = Object.defineProperty;
10
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- const defaultCacheStore = new LRUCache(1e3);
12
- const capitalCase = /* @__PURE__ */ __name((value, options) => {
13
- if (typeof value !== "string") {
14
- return "";
15
- }
16
- const shouldCache = options?.cache ?? false;
17
- const cacheStore = options?.cacheStore ?? defaultCacheStore;
18
- let cacheKey;
19
- if (shouldCache) {
20
- cacheKey = generateCacheKey(value, options);
21
- }
22
- if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
23
- return cacheStore.get(cacheKey);
24
- }
25
- const words = splitByCase(value, {
26
- handleAnsi: options?.handleAnsi,
27
- handleEmoji: options?.handleEmoji,
28
- knownAcronyms: options?.knownAcronyms,
29
- locale: options?.locale,
30
- normalize: options?.normalize,
31
- separators: void 0,
32
- stripAnsi: options?.stripAnsi,
33
- stripEmoji: options?.stripEmoji
34
- });
35
- const processed = words.map((word) => {
36
- if (RE_FAST_ANSI.test(word)) {
37
- return word;
38
- }
39
- const split = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
40
- return upperFirst(options?.locale ? split.toLocaleLowerCase(options.locale) : split.toLocaleLowerCase(), options);
41
- });
42
- const result = joinSegments(processed, " ");
43
- if (shouldCache && cacheKey) {
44
- cacheStore.set(cacheKey, result);
45
- }
46
- return result;
47
- }, "capitalCase");
48
-
49
- export { capitalCase as default };
1
+ var c=Object.defineProperty;var l=(r,o)=>c(r,"name",{value:o,configurable:!0});import{R as p}from"../packem_shared/constants-Cd17VNEv.mjs";import f from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{splitByCase as u}from"./split-by-case.mjs";import A from"./upper-first.mjs";import{a as d}from"../packem_shared/generate-cache-key-DPByFaMH.mjs";import h from"../packem_shared/joinSegments-H7QJ7rwJ.mjs";import{l as y}from"../packem_shared/normalize-german-eszett-4k1qRtEP.mjs";var j=Object.defineProperty,w=l((r,o)=>j(r,"name",{value:o,configurable:!0}),"l");const E=new f(1e3),z=w((r,o)=>{if(typeof r!="string")return"";const e=o?.cache??!1,s=o?.cacheStore??E;let a;if(e&&(a=d(r,o)),e&&a&&s.has(a))return s.get(a);const m=u(r,{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(p.test(t))return t;const n=o?.locale?.startsWith("de")?y(t):t;return A(o?.locale?n.toLocaleLowerCase(o.locale):n.toLocaleLowerCase(),o)}),i=h(m," ");return e&&a&&s.set(a,i),i},"capitalCase");export{z as default};
@@ -1,11 +1 @@
1
- 'use strict';
2
-
3
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
4
- const case_kebabCase = require('./kebab-case.cjs');
5
-
6
- var __defProp = Object.defineProperty;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- const defaultCacheStore = new LRUCache(1e3);
9
- const constantCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "_", toUpperCase: true }), "constantCase");
10
-
11
- module.exports = constantCase;
1
+ "use strict";var t=Object.defineProperty;var a=(e,r)=>t(e,"name",{value:r,configurable:!0});const s=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),c=require("./kebab-case.cjs");var n=Object.defineProperty,o=a((e,r)=>n(e,"name",{value:r,configurable:!0}),"s");const u=new s(1e3),b=o((e,r)=>c.kebabCase(e,{cacheStore:u,...r,joiner:"_",toUpperCase:!0}),"constantCase");module.exports=b;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-_jqW_ZOt.mjs';
2
- import '../packem_shared/types-DmfKbIaI.mjs';
1
+ import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-mlwFVBiS.mjs';
2
+ import '../packem_shared/types-BSdIWVzn.mjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.mjs';
4
4
 
5
5
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-DcGtApe2.js';
2
- import '../packem_shared/types-DmfKbIaI.js';
1
+ import { C as CaseOptions, c as ConstantCase } from '../packem_shared/types-BfGNLD2K.js';
2
+ import '../packem_shared/types-BSdIWVzn.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
@@ -1,9 +1 @@
1
- import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
2
- import { kebabCase } from './kebab-case.mjs';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- const defaultCacheStore = new LRUCache(1e3);
7
- const constantCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "_", toUpperCase: true }), "constantCase");
8
-
9
- export { constantCase as default };
1
+ var t=Object.defineProperty;var a=(e,r)=>t(e,"name",{value:r,configurable:!0});import o from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var s=Object.defineProperty,c=a((e,r)=>s(e,"name",{value:r,configurable:!0}),"s");const p=new o(1e3),u=c((e,r)=>n(e,{cacheStore:p,...r,joiner:"_",toUpperCase:!0}),"constantCase");export{u as default};
@@ -1,11 +1 @@
1
- 'use strict';
2
-
3
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
4
- const case_kebabCase = require('./kebab-case.cjs');
5
-
6
- var __defProp = Object.defineProperty;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- const defaultCacheStore = new LRUCache(1e3);
9
- const dotCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "." }), "dotCase");
10
-
11
- module.exports = dotCase;
1
+ "use strict";var s=Object.defineProperty;var a=(e,r)=>s(e,"name",{value:r,configurable:!0});const t=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),c=require("./kebab-case.cjs");var o=Object.defineProperty,n=a((e,r)=>o(e,"name",{value:r,configurable:!0}),"o");const i=new t(1e3),b=n((e,r)=>c.kebabCase(e,{cacheStore:i,...r,joiner:"."}),"dotCase");module.exports=b;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, D as DotCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, D as DotCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, D as DotCase } from '../packem_shared/types-_jqW_ZOt.mjs';
2
- import '../packem_shared/types-DmfKbIaI.mjs';
1
+ import { C as CaseOptions, D as DotCase } from '../packem_shared/types-mlwFVBiS.mjs';
2
+ import '../packem_shared/types-BSdIWVzn.mjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.mjs';
4
4
 
5
5
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, D as DotCase } from '../packem_shared/types-DcGtApe2.js';
2
- import '../packem_shared/types-DmfKbIaI.js';
1
+ import { C as CaseOptions, D as DotCase } from '../packem_shared/types-BfGNLD2K.js';
2
+ import '../packem_shared/types-BSdIWVzn.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
@@ -1,9 +1 @@
1
- import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
2
- import { kebabCase } from './kebab-case.mjs';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- const defaultCacheStore = new LRUCache(1e3);
7
- const dotCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "." }), "dotCase");
8
-
9
- export { dotCase as default };
1
+ var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var i=Object.defineProperty,s=o((e,r)=>i(e,"name",{value:r,configurable:!0}),"o");const c=new t(1e3),p=s((e,r)=>n(e,{cacheStore:c,...r,joiner:"."}),"dotCase");export{p as default};
@@ -1,11 +1 @@
1
- 'use strict';
2
-
3
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
4
- const case_kebabCase = require('./kebab-case.cjs');
5
-
6
- var __defProp = Object.defineProperty;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- const defaultCacheStore = new LRUCache(1e3);
9
- const flatCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "" }), "flatCase");
10
-
11
- module.exports = flatCase;
1
+ "use strict";var s=Object.defineProperty;var r=(e,a)=>s(e,"name",{value:a,configurable:!0});const t=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),c=require("./kebab-case.cjs");var n=Object.defineProperty,i=r((e,a)=>n(e,"name",{value:a,configurable:!0}),"a");const o=new t(1e3),b=i((e,a)=>c.kebabCase(e,{cacheStore:o,...a,joiner:""}),"flatCase");module.exports=b;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-_jqW_ZOt.mjs';
2
- import '../packem_shared/types-DmfKbIaI.mjs';
1
+ import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-mlwFVBiS.mjs';
2
+ import '../packem_shared/types-BSdIWVzn.mjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.mjs';
4
4
 
5
5
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
@@ -1,5 +1,5 @@
1
- import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-DcGtApe2.js';
2
- import '../packem_shared/types-DmfKbIaI.js';
1
+ import { C as CaseOptions, F as FlatCase } from '../packem_shared/types-BfGNLD2K.js';
2
+ import '../packem_shared/types-BSdIWVzn.js';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.js';
4
4
 
5
5
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
@@ -1,9 +1 @@
1
- import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
2
- import { kebabCase } from './kebab-case.mjs';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- const defaultCacheStore = new LRUCache(1e3);
7
- const flatCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: "" }), "flatCase");
8
-
9
- export { flatCase as default };
1
+ var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.mjs";import{kebabCase as n}from"./kebab-case.mjs";var f=Object.defineProperty,i=r((e,a)=>f(e,"name",{value:a,configurable:!0}),"a");const s=new t(1e3),l=i((e,a)=>n(e,{cacheStore:s,...a,joiner:""}),"flatCase");export{l as default};
@@ -1,61 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const node_util = require('node:util');
6
- const constants = require('../packem_shared/constants-CKuHriHc.cjs');
7
- const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
8
- const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
9
-
10
- var __defProp = Object.defineProperty;
11
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
12
- const defaultCacheStore = new LRUCache(1e3);
13
- const flipCase = /* @__PURE__ */ __name((value, options) => {
14
- if (typeof value !== "string" || value.length === 0) {
15
- return "";
16
- }
17
- const shouldCache = options?.cache ?? false;
18
- const cacheStore = options?.cacheStore ?? defaultCacheStore;
19
- let cacheKey;
20
- if (shouldCache) {
21
- cacheKey = generateCacheKey.generateCacheKey(value, options);
22
- }
23
- if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
24
- return cacheStore.get(cacheKey);
25
- }
26
- let processedValue = value;
27
- if (options?.stripEmoji) {
28
- processedValue = constants.stripEmoji(processedValue);
29
- }
30
- if (options?.stripAnsi) {
31
- processedValue = node_util.stripVTControlCharacters(processedValue);
32
- }
33
- let result = "";
34
- let index = 0;
35
- while (index < processedValue.length) {
36
- if (options?.handleAnsi && processedValue[index] === "\x1B") {
37
- let ansiSequence = processedValue[index];
38
- index++;
39
- while (index < processedValue.length && processedValue[index] !== "m") {
40
- ansiSequence += processedValue[index];
41
- index++;
42
- }
43
- if (index < processedValue.length) {
44
- ansiSequence += processedValue[index];
45
- result += ansiSequence;
46
- }
47
- index++;
48
- continue;
49
- }
50
- const char = processedValue[index];
51
- const lowerChar = options?.locale ? char.toLocaleLowerCase(options.locale) : char.toLowerCase();
52
- result += char === lowerChar ? options?.locale ? char.toLocaleUpperCase(options.locale) : char.toUpperCase() : lowerChar;
53
- index++;
54
- }
55
- if (shouldCache && cacheKey) {
56
- cacheStore.set(cacheKey, result);
57
- }
58
- return result;
59
- }, "flipCase");
60
-
61
- exports.flipCase = flipCase;
1
+ "use strict";var p=Object.defineProperty;var f=(a,e)=>p(a,"name",{value:e,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("node:util"),C=require("../packem_shared/constants-D3K8u3G8.cjs"),g=require("../packem_shared/LRUCache-TYqfUYE5.cjs"),d=require("../packem_shared/generate-cache-key-BZf0GiMs.cjs");var v=Object.defineProperty,L=f((a,e)=>v(a,"name",{value:e,configurable:!0}),"p");const b=new g(1e3),m=L((a,e)=>{if(typeof a!="string"||a.length===0)return"";const i=e?.cache??!1,s=e?.cacheStore??b;let l;if(i&&(l=d.a(a,e)),i&&l&&s.has(l))return s.get(l);let t=a;e?.stripEmoji&&(t=C.s(t)),e?.stripAnsi&&(t=h.stripVTControlCharacters(t));let n="",o=0;for(;o<t.length;){if(e?.handleAnsi&&t[o]==="\x1B"){let c=t[o];for(o++;o<t.length&&t[o]!=="m";)c+=t[o],o++;o<t.length&&(c+=t[o],n+=c),o++;continue}const r=t[o],u=e?.locale?r.toLocaleLowerCase(e.locale):r.toLowerCase();n+=r===u?e?.locale?r.toLocaleUpperCase(e.locale):r.toUpperCase():u,o++}return i&&l&&s.set(l,n),n},"flipCase");exports.flipCase=m;
@@ -1,8 +1,9 @@
1
- import { C as CaseOptions, d as FlipCase } from '../packem_shared/types-C5Pk8B8Q.cjs';
2
- import '../packem_shared/types-DmfKbIaI.cjs';
1
+ import { C as CaseOptions, d as FlipCase } from '../packem_shared/types-DrtiqNkK.cjs';
2
+ import '../packem_shared/types-BSdIWVzn.cjs';
3
3
  import '../packem_shared/lru-cache-B_t27XwI.cjs';
4
4
 
5
5
  type FlipOptions = Omit<CaseOptions, "handleEmoji">;
6
6
  declare const flipCase: <T extends string = string>(value?: T, options?: FlipOptions) => FlipCase<T>;
7
7
 
8
- export { type FlipOptions, flipCase };
8
+ export { flipCase };
9
+ export type { FlipOptions };