@visulima/string 1.0.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 (170) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE.md +77 -0
  3. package/README.md +880 -0
  4. package/dist/case/camel-case.cjs +59 -0
  5. package/dist/case/camel-case.d.cts +7 -0
  6. package/dist/case/camel-case.d.mts +7 -0
  7. package/dist/case/camel-case.d.ts +7 -0
  8. package/dist/case/camel-case.mjs +57 -0
  9. package/dist/case/capital-case.cjs +51 -0
  10. package/dist/case/capital-case.d.cts +7 -0
  11. package/dist/case/capital-case.d.mts +7 -0
  12. package/dist/case/capital-case.d.ts +7 -0
  13. package/dist/case/capital-case.mjs +49 -0
  14. package/dist/case/constant-case.cjs +11 -0
  15. package/dist/case/constant-case.d.cts +7 -0
  16. package/dist/case/constant-case.d.mts +7 -0
  17. package/dist/case/constant-case.d.ts +7 -0
  18. package/dist/case/constant-case.mjs +9 -0
  19. package/dist/case/dot-case.cjs +11 -0
  20. package/dist/case/dot-case.d.cts +7 -0
  21. package/dist/case/dot-case.d.mts +7 -0
  22. package/dist/case/dot-case.d.ts +7 -0
  23. package/dist/case/dot-case.mjs +9 -0
  24. package/dist/case/flat-case.cjs +11 -0
  25. package/dist/case/flat-case.d.cts +7 -0
  26. package/dist/case/flat-case.d.mts +7 -0
  27. package/dist/case/flat-case.d.ts +7 -0
  28. package/dist/case/flat-case.mjs +9 -0
  29. package/dist/case/flip-case.cjs +61 -0
  30. package/dist/case/flip-case.d.cts +8 -0
  31. package/dist/case/flip-case.d.mts +8 -0
  32. package/dist/case/flip-case.d.ts +8 -0
  33. package/dist/case/flip-case.mjs +57 -0
  34. package/dist/case/identify-case.cjs +30 -0
  35. package/dist/case/identify-case.d.cts +7 -0
  36. package/dist/case/identify-case.d.mts +7 -0
  37. package/dist/case/identify-case.d.ts +7 -0
  38. package/dist/case/identify-case.mjs +28 -0
  39. package/dist/case/index.cjs +47 -0
  40. package/dist/case/index.d.cts +26 -0
  41. package/dist/case/index.d.mts +26 -0
  42. package/dist/case/index.d.ts +26 -0
  43. package/dist/case/index.mjs +20 -0
  44. package/dist/case/kebab-case.cjs +61 -0
  45. package/dist/case/kebab-case.d.cts +11 -0
  46. package/dist/case/kebab-case.d.mts +11 -0
  47. package/dist/case/kebab-case.d.ts +11 -0
  48. package/dist/case/kebab-case.mjs +57 -0
  49. package/dist/case/lower-first.cjs +13 -0
  50. package/dist/case/lower-first.d.cts +7 -0
  51. package/dist/case/lower-first.d.mts +7 -0
  52. package/dist/case/lower-first.d.ts +7 -0
  53. package/dist/case/lower-first.mjs +11 -0
  54. package/dist/case/no-case.cjs +11 -0
  55. package/dist/case/no-case.d.cts +7 -0
  56. package/dist/case/no-case.d.mts +7 -0
  57. package/dist/case/no-case.d.ts +7 -0
  58. package/dist/case/no-case.mjs +9 -0
  59. package/dist/case/pascal-case.cjs +52 -0
  60. package/dist/case/pascal-case.d.cts +7 -0
  61. package/dist/case/pascal-case.d.mts +7 -0
  62. package/dist/case/pascal-case.d.ts +7 -0
  63. package/dist/case/pascal-case.mjs +50 -0
  64. package/dist/case/pascal-snake-case.cjs +32 -0
  65. package/dist/case/pascal-snake-case.d.cts +7 -0
  66. package/dist/case/pascal-snake-case.d.mts +7 -0
  67. package/dist/case/pascal-snake-case.d.ts +7 -0
  68. package/dist/case/pascal-snake-case.mjs +30 -0
  69. package/dist/case/path-case.cjs +11 -0
  70. package/dist/case/path-case.d.cts +7 -0
  71. package/dist/case/path-case.d.mts +7 -0
  72. package/dist/case/path-case.d.ts +7 -0
  73. package/dist/case/path-case.mjs +9 -0
  74. package/dist/case/sentence-case.cjs +58 -0
  75. package/dist/case/sentence-case.d.cts +7 -0
  76. package/dist/case/sentence-case.d.mts +7 -0
  77. package/dist/case/sentence-case.d.ts +7 -0
  78. package/dist/case/sentence-case.mjs +56 -0
  79. package/dist/case/snake-case.cjs +11 -0
  80. package/dist/case/snake-case.d.cts +7 -0
  81. package/dist/case/snake-case.d.mts +7 -0
  82. package/dist/case/snake-case.d.ts +7 -0
  83. package/dist/case/snake-case.mjs +9 -0
  84. package/dist/case/split-by-case.cjs +638 -0
  85. package/dist/case/split-by-case.d.cts +16 -0
  86. package/dist/case/split-by-case.d.mts +16 -0
  87. package/dist/case/split-by-case.d.ts +16 -0
  88. package/dist/case/split-by-case.mjs +634 -0
  89. package/dist/case/title-case.cjs +47 -0
  90. package/dist/case/title-case.d.cts +7 -0
  91. package/dist/case/title-case.d.mts +7 -0
  92. package/dist/case/title-case.d.ts +7 -0
  93. package/dist/case/title-case.mjs +45 -0
  94. package/dist/case/train-case.cjs +44 -0
  95. package/dist/case/train-case.d.cts +7 -0
  96. package/dist/case/train-case.d.mts +7 -0
  97. package/dist/case/train-case.d.ts +7 -0
  98. package/dist/case/train-case.mjs +42 -0
  99. package/dist/case/upper-first.cjs +13 -0
  100. package/dist/case/upper-first.d.cts +7 -0
  101. package/dist/case/upper-first.d.mts +7 -0
  102. package/dist/case/upper-first.d.ts +7 -0
  103. package/dist/case/upper-first.mjs +11 -0
  104. package/dist/get-string-truncated-width.cjs +386 -0
  105. package/dist/get-string-truncated-width.d.cts +25 -0
  106. package/dist/get-string-truncated-width.d.mts +25 -0
  107. package/dist/get-string-truncated-width.d.ts +25 -0
  108. package/dist/get-string-truncated-width.mjs +382 -0
  109. package/dist/get-string-width.cjs +11 -0
  110. package/dist/get-string-width.d.cts +6 -0
  111. package/dist/get-string-width.d.mts +6 -0
  112. package/dist/get-string-width.d.ts +6 -0
  113. package/dist/get-string-width.mjs +7 -0
  114. package/dist/index.cjs +60 -0
  115. package/dist/index.d.cts +43 -0
  116. package/dist/index.d.mts +43 -0
  117. package/dist/index.d.ts +43 -0
  118. package/dist/index.mjs +26 -0
  119. package/dist/native-string-types.d.cts +128 -0
  120. package/dist/native-string-types.d.mts +128 -0
  121. package/dist/native-string-types.d.ts +128 -0
  122. package/dist/outdent.cjs +122 -0
  123. package/dist/outdent.d.cts +15 -0
  124. package/dist/outdent.d.mts +15 -0
  125. package/dist/outdent.d.ts +15 -0
  126. package/dist/outdent.mjs +118 -0
  127. package/dist/packem_shared/LRUCache-Crb-m7cw.cjs +53 -0
  128. package/dist/packem_shared/LRUCache-udNErhWw.mjs +51 -0
  129. package/dist/packem_shared/WrapMode-BgOOthJV.mjs +545 -0
  130. package/dist/packem_shared/WrapMode-ZqTeXK8X.cjs +550 -0
  131. package/dist/packem_shared/constants-BnVGLrDr.mjs +99 -0
  132. package/dist/packem_shared/constants-HevSYUjU.cjs +149 -0
  133. package/dist/packem_shared/generate-cache-key-D8f1auDB.cjs +10 -0
  134. package/dist/packem_shared/generate-cache-key-YSju5pj2.mjs +8 -0
  135. package/dist/packem_shared/joinSegments-BH1CT4dK.cjs +48 -0
  136. package/dist/packem_shared/joinSegments-BHY8PPnk.mjs +46 -0
  137. package/dist/packem_shared/normalize-german-eszett-DJK0S2qj.cjs +11 -0
  138. package/dist/packem_shared/normalize-german-eszett-fpJ4lZL6.mjs +9 -0
  139. package/dist/packem_shared/types-BAd3WDHo.d.mts +59 -0
  140. package/dist/packem_shared/types-BNbQJg02.d.cts +41 -0
  141. package/dist/packem_shared/types-BNbQJg02.d.mts +41 -0
  142. package/dist/packem_shared/types-BNbQJg02.d.ts +41 -0
  143. package/dist/packem_shared/types-BttWSSIk.d.ts +59 -0
  144. package/dist/packem_shared/types-D2-6p7t1.d.cts +59 -0
  145. package/dist/slice.cjs +413 -0
  146. package/dist/slice.d.cts +10 -0
  147. package/dist/slice.d.mts +10 -0
  148. package/dist/slice.d.ts +10 -0
  149. package/dist/slice.mjs +409 -0
  150. package/dist/test/utils.cjs +77 -0
  151. package/dist/test/utils.d.cts +30 -0
  152. package/dist/test/utils.d.mts +30 -0
  153. package/dist/test/utils.d.ts +30 -0
  154. package/dist/test/utils.mjs +71 -0
  155. package/dist/test/vitest.cjs +11 -0
  156. package/dist/test/vitest.d.cts +8 -0
  157. package/dist/test/vitest.d.mts +8 -0
  158. package/dist/test/vitest.d.ts +8 -0
  159. package/dist/test/vitest.mjs +7 -0
  160. package/dist/truncate.cjs +90 -0
  161. package/dist/truncate.d.cts +12 -0
  162. package/dist/truncate.d.mts +12 -0
  163. package/dist/truncate.d.ts +12 -0
  164. package/dist/truncate.mjs +86 -0
  165. package/dist/utils.cjs +9 -0
  166. package/dist/utils.d.cts +14 -0
  167. package/dist/utils.d.mts +14 -0
  168. package/dist/utils.d.ts +14 -0
  169. package/dist/utils.mjs +1 -0
  170. package/package.json +468 -0
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const identifyCase = /* @__PURE__ */ __name((value) => {
4
+ if (typeof value !== "string" || !value) {
5
+ return "lower";
6
+ }
7
+ if (value === value.toLowerCase()) {
8
+ if (value.includes("_")) {
9
+ return "snake";
10
+ }
11
+ if (value.includes("-")) {
12
+ return "kebab";
13
+ }
14
+ return "lower";
15
+ }
16
+ if (value === value.toUpperCase()) {
17
+ return "upper";
18
+ }
19
+ if (/^[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)*$/.test(value)) {
20
+ return "pascal";
21
+ }
22
+ if (/^[a-z0-9]+(?:[A-Z][a-z0-9]+)*$/.test(value)) {
23
+ return "camel";
24
+ }
25
+ return "mixed";
26
+ }, "identifyCase");
27
+
28
+ export { identifyCase as default };
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const case_camelCase = require('./camel-case.cjs');
6
+ const case_capitalCase = require('./capital-case.cjs');
7
+ const case_constantCase = require('./constant-case.cjs');
8
+ const case_dotCase = require('./dot-case.cjs');
9
+ const case_flatCase = require('./flat-case.cjs');
10
+ const case_flipCase = require('./flip-case.cjs');
11
+ const case_identifyCase = require('./identify-case.cjs');
12
+ const case_kebabCase = require('./kebab-case.cjs');
13
+ const case_lowerFirst = require('./lower-first.cjs');
14
+ const case_noCase = require('./no-case.cjs');
15
+ const case_pascalCase = require('./pascal-case.cjs');
16
+ const case_pascalSnakeCase = require('./pascal-snake-case.cjs');
17
+ const case_pathCase = require('./path-case.cjs');
18
+ const case_sentenceCase = require('./sentence-case.cjs');
19
+ const case_snakeCase = require('./snake-case.cjs');
20
+ const case_splitByCase = require('./split-by-case.cjs');
21
+ const case_titleCase = require('./title-case.cjs');
22
+ const case_trainCase = require('./train-case.cjs');
23
+ const case_upperFirst = require('./upper-first.cjs');
24
+ const joinSegments = require('../packem_shared/joinSegments-BH1CT4dK.cjs');
25
+
26
+
27
+
28
+ exports.camelCase = case_camelCase;
29
+ exports.capitalCase = case_capitalCase;
30
+ exports.constantCase = case_constantCase;
31
+ exports.dotCase = case_dotCase;
32
+ exports.flatCase = case_flatCase;
33
+ exports.flipCase = case_flipCase.flipCase;
34
+ exports.identifyCase = case_identifyCase;
35
+ exports.kebabCase = case_kebabCase.kebabCase;
36
+ exports.lowerFirst = case_lowerFirst;
37
+ exports.noCase = case_noCase;
38
+ exports.pascalCase = case_pascalCase;
39
+ exports.pascalSnakeCase = case_pascalSnakeCase;
40
+ exports.pathCase = case_pathCase;
41
+ exports.sentenceCase = case_sentenceCase;
42
+ exports.snakeCase = case_snakeCase;
43
+ exports.splitByCase = case_splitByCase.splitByCase;
44
+ exports.titleCase = case_titleCase;
45
+ exports.trainCase = case_trainCase;
46
+ exports.upperFirst = case_upperFirst;
47
+ exports.joinSegments = joinSegments;
@@ -0,0 +1,26 @@
1
+ export { N as NodeLocale } from '../packem_shared/types-BNbQJg02.cjs';
2
+ export { default as camelCase } from './camel-case.cjs';
3
+ export { default as capitalCase } from './capital-case.cjs';
4
+ export { default as constantCase } from './constant-case.cjs';
5
+ export { default as dotCase } from './dot-case.cjs';
6
+ export { default as flatCase } from './flat-case.cjs';
7
+ export { FlipOptions, flipCase } from './flip-case.cjs';
8
+ export { default as identifyCase } from './identify-case.cjs';
9
+ export { KebabCaseOptions, kebabCase } from './kebab-case.cjs';
10
+ export { default as lowerFirst } from './lower-first.cjs';
11
+ export { default as noCase } from './no-case.cjs';
12
+ export { default as pascalCase } from './pascal-case.cjs';
13
+ export { default as pascalSnakeCase } from './pascal-snake-case.cjs';
14
+ export { default as pathCase } from './path-case.cjs';
15
+ export { default as sentenceCase } from './sentence-case.cjs';
16
+ export { default as snakeCase } from './snake-case.cjs';
17
+ export { SplitOptions, splitByCase } from './split-by-case.cjs';
18
+ export { default as titleCase } from './title-case.cjs';
19
+ export { default as trainCase } from './train-case.cjs';
20
+ export { C as CamelCase, a as CapitalCase, b as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from '../packem_shared/types-D2-6p7t1.cjs';
21
+ export { default as upperFirst } from './upper-first.cjs';
22
+ import '../utils.cjs';
23
+
24
+ declare const joinSegments: <T extends string = string>(segments: string[], joiner: string) => T;
25
+
26
+ export { joinSegments };
@@ -0,0 +1,26 @@
1
+ export { N as NodeLocale } from '../packem_shared/types-BNbQJg02.mjs';
2
+ export { default as camelCase } from './camel-case.mjs';
3
+ export { default as capitalCase } from './capital-case.mjs';
4
+ export { default as constantCase } from './constant-case.mjs';
5
+ export { default as dotCase } from './dot-case.mjs';
6
+ export { default as flatCase } from './flat-case.mjs';
7
+ export { FlipOptions, flipCase } from './flip-case.mjs';
8
+ export { default as identifyCase } from './identify-case.mjs';
9
+ export { KebabCaseOptions, kebabCase } from './kebab-case.mjs';
10
+ export { default as lowerFirst } from './lower-first.mjs';
11
+ export { default as noCase } from './no-case.mjs';
12
+ export { default as pascalCase } from './pascal-case.mjs';
13
+ export { default as pascalSnakeCase } from './pascal-snake-case.mjs';
14
+ export { default as pathCase } from './path-case.mjs';
15
+ export { default as sentenceCase } from './sentence-case.mjs';
16
+ export { default as snakeCase } from './snake-case.mjs';
17
+ export { SplitOptions, splitByCase } from './split-by-case.mjs';
18
+ export { default as titleCase } from './title-case.mjs';
19
+ export { default as trainCase } from './train-case.mjs';
20
+ export { C as CamelCase, a as CapitalCase, b as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from '../packem_shared/types-BAd3WDHo.mjs';
21
+ export { default as upperFirst } from './upper-first.mjs';
22
+ import '../utils.mjs';
23
+
24
+ declare const joinSegments: <T extends string = string>(segments: string[], joiner: string) => T;
25
+
26
+ export { joinSegments };
@@ -0,0 +1,26 @@
1
+ export { N as NodeLocale } from '../packem_shared/types-BNbQJg02.js';
2
+ export { default as camelCase } from './camel-case.js';
3
+ export { default as capitalCase } from './capital-case.js';
4
+ export { default as constantCase } from './constant-case.js';
5
+ export { default as dotCase } from './dot-case.js';
6
+ export { default as flatCase } from './flat-case.js';
7
+ export { FlipOptions, flipCase } from './flip-case.js';
8
+ export { default as identifyCase } from './identify-case.js';
9
+ export { KebabCaseOptions, kebabCase } from './kebab-case.js';
10
+ export { default as lowerFirst } from './lower-first.js';
11
+ export { default as noCase } from './no-case.js';
12
+ export { default as pascalCase } from './pascal-case.js';
13
+ export { default as pascalSnakeCase } from './pascal-snake-case.js';
14
+ export { default as pathCase } from './path-case.js';
15
+ export { default as sentenceCase } from './sentence-case.js';
16
+ export { default as snakeCase } from './snake-case.js';
17
+ export { SplitOptions, splitByCase } from './split-by-case.js';
18
+ export { default as titleCase } from './title-case.js';
19
+ export { default as trainCase } from './train-case.js';
20
+ export { C as CamelCase, a as CapitalCase, b as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from '../packem_shared/types-BttWSSIk.js';
21
+ export { default as upperFirst } from './upper-first.js';
22
+ import '../utils.js';
23
+
24
+ declare const joinSegments: <T extends string = string>(segments: string[], joiner: string) => T;
25
+
26
+ export { joinSegments };
@@ -0,0 +1,20 @@
1
+ export { default as camelCase } from './camel-case.mjs';
2
+ export { default as capitalCase } from './capital-case.mjs';
3
+ export { default as constantCase } from './constant-case.mjs';
4
+ export { default as dotCase } from './dot-case.mjs';
5
+ export { default as flatCase } from './flat-case.mjs';
6
+ export { flipCase } from './flip-case.mjs';
7
+ export { default as identifyCase } from './identify-case.mjs';
8
+ export { kebabCase } from './kebab-case.mjs';
9
+ export { default as lowerFirst } from './lower-first.mjs';
10
+ export { default as noCase } from './no-case.mjs';
11
+ export { default as pascalCase } from './pascal-case.mjs';
12
+ export { default as pascalSnakeCase } from './pascal-snake-case.mjs';
13
+ export { default as pathCase } from './path-case.mjs';
14
+ export { default as sentenceCase } from './sentence-case.mjs';
15
+ export { default as snakeCase } from './snake-case.mjs';
16
+ export { splitByCase } from './split-by-case.mjs';
17
+ export { default as titleCase } from './title-case.mjs';
18
+ export { default as trainCase } from './train-case.mjs';
19
+ export { default as upperFirst } from './upper-first.mjs';
20
+ export { default as joinSegments } from '../packem_shared/joinSegments-BHY8PPnk.mjs';
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const constants = require('../packem_shared/constants-HevSYUjU.cjs');
6
+ const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
7
+ const case_splitByCase = require('./split-by-case.cjs');
8
+ const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
9
+ const joinSegments = require('../packem_shared/joinSegments-BH1CT4dK.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 kebabCase = /* @__PURE__ */ __name((value, options) => {
16
+ if (typeof value !== "string") {
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
+ const words = case_splitByCase.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
+ });
38
+ const processed = words.map((word) => {
39
+ if (options?.handleAnsi && constants.RE_FAST_ANSI.test(word)) {
40
+ return word;
41
+ }
42
+ if (options?.toUpperCase) {
43
+ if (options.locale) {
44
+ return word.toLocaleUpperCase(options.locale);
45
+ }
46
+ return word.toUpperCase();
47
+ }
48
+ const split = options?.locale?.startsWith("de") ? normalizeGermanEszett.normalizeGermanEszett(word) : word;
49
+ if (options?.locale) {
50
+ return split.toLocaleLowerCase(options.locale);
51
+ }
52
+ return split.toLowerCase();
53
+ });
54
+ const result = joinSegments(processed, options?.joiner ?? "-");
55
+ if (shouldCache && cacheKey) {
56
+ cacheStore.set(cacheKey, result);
57
+ }
58
+ return result;
59
+ }, "kebabCase");
60
+
61
+ exports.kebabCase = kebabCase;
@@ -0,0 +1,11 @@
1
+ import { b as CaseOptions, K as KebabCase } from '../packem_shared/types-D2-6p7t1.cjs';
2
+ import '../packem_shared/types-BNbQJg02.cjs';
3
+ import '../utils.cjs';
4
+
5
+ interface KebabCaseOptions extends CaseOptions {
6
+ joiner?: string;
7
+ toUpperCase?: boolean;
8
+ }
9
+ declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
10
+
11
+ export { type KebabCaseOptions, kebabCase };
@@ -0,0 +1,11 @@
1
+ import { b as CaseOptions, K as KebabCase } from '../packem_shared/types-BAd3WDHo.mjs';
2
+ import '../packem_shared/types-BNbQJg02.mjs';
3
+ import '../utils.mjs';
4
+
5
+ interface KebabCaseOptions extends CaseOptions {
6
+ joiner?: string;
7
+ toUpperCase?: boolean;
8
+ }
9
+ declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
10
+
11
+ export { type KebabCaseOptions, kebabCase };
@@ -0,0 +1,11 @@
1
+ import { b as CaseOptions, K as KebabCase } from '../packem_shared/types-BttWSSIk.js';
2
+ import '../packem_shared/types-BNbQJg02.js';
3
+ import '../utils.js';
4
+
5
+ interface KebabCaseOptions extends CaseOptions {
6
+ joiner?: string;
7
+ toUpperCase?: boolean;
8
+ }
9
+ declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
10
+
11
+ export { type KebabCaseOptions, kebabCase };
@@ -0,0 +1,57 @@
1
+ import { R as RE_FAST_ANSI } from '../packem_shared/constants-BnVGLrDr.mjs';
2
+ import LRUCache from '../packem_shared/LRUCache-udNErhWw.mjs';
3
+ import { splitByCase } from './split-by-case.mjs';
4
+ import { g as generateCacheKey } from '../packem_shared/generate-cache-key-YSju5pj2.mjs';
5
+ import joinSegments from '../packem_shared/joinSegments-BHY8PPnk.mjs';
6
+ import { n as normalizeGermanEszett } from '../packem_shared/normalize-german-eszett-fpJ4lZL6.mjs';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ const defaultCacheStore = new LRUCache(1e3);
11
+ const kebabCase = /* @__PURE__ */ __name((value, options) => {
12
+ if (typeof value !== "string") {
13
+ return "";
14
+ }
15
+ const shouldCache = options?.cache ?? false;
16
+ const cacheStore = options?.cacheStore ?? defaultCacheStore;
17
+ let cacheKey;
18
+ if (shouldCache) {
19
+ cacheKey = generateCacheKey(value, options);
20
+ }
21
+ if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
22
+ return cacheStore.get(cacheKey);
23
+ }
24
+ const words = splitByCase(value, {
25
+ handleAnsi: options?.handleAnsi,
26
+ handleEmoji: options?.handleEmoji,
27
+ knownAcronyms: options?.knownAcronyms,
28
+ locale: options?.locale,
29
+ normalize: options?.normalize,
30
+ separators: void 0,
31
+ stripAnsi: options?.stripAnsi,
32
+ stripEmoji: options?.stripEmoji
33
+ });
34
+ const processed = words.map((word) => {
35
+ if (options?.handleAnsi && RE_FAST_ANSI.test(word)) {
36
+ return word;
37
+ }
38
+ if (options?.toUpperCase) {
39
+ if (options.locale) {
40
+ return word.toLocaleUpperCase(options.locale);
41
+ }
42
+ return word.toUpperCase();
43
+ }
44
+ const split = options?.locale?.startsWith("de") ? normalizeGermanEszett(word) : word;
45
+ if (options?.locale) {
46
+ return split.toLocaleLowerCase(options.locale);
47
+ }
48
+ return split.toLowerCase();
49
+ });
50
+ const result = joinSegments(processed, options?.joiner ?? "-");
51
+ if (shouldCache && cacheKey) {
52
+ cacheStore.set(cacheKey, result);
53
+ }
54
+ return result;
55
+ }, "kebabCase");
56
+
57
+ export { kebabCase };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ const lowerFirst = /* @__PURE__ */ __name((value, options) => {
6
+ if (typeof value !== "string" || value === "") {
7
+ return "";
8
+ }
9
+ const firstChar = options?.locale ? value[0].toLocaleLowerCase(options.locale) : value[0].toLowerCase();
10
+ return firstChar + value.slice(1);
11
+ }, "lowerFirst");
12
+
13
+ module.exports = lowerFirst;
@@ -0,0 +1,7 @@
1
+ import { L as LocaleOptions, e as LowerFirst } from '../packem_shared/types-D2-6p7t1.cjs';
2
+ import '../packem_shared/types-BNbQJg02.cjs';
3
+ import '../utils.cjs';
4
+
5
+ declare const lowerFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => LowerFirst<T>;
6
+
7
+ export = lowerFirst;
@@ -0,0 +1,7 @@
1
+ import { L as LocaleOptions, e as LowerFirst } from '../packem_shared/types-BAd3WDHo.mjs';
2
+ import '../packem_shared/types-BNbQJg02.mjs';
3
+ import '../utils.mjs';
4
+
5
+ declare const lowerFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => LowerFirst<T>;
6
+
7
+ export { lowerFirst as default };
@@ -0,0 +1,7 @@
1
+ import { L as LocaleOptions, e as LowerFirst } from '../packem_shared/types-BttWSSIk.js';
2
+ import '../packem_shared/types-BNbQJg02.js';
3
+ import '../utils.js';
4
+
5
+ declare const lowerFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => LowerFirst<T>;
6
+
7
+ export = lowerFirst;
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const lowerFirst = /* @__PURE__ */ __name((value, options) => {
4
+ if (typeof value !== "string" || value === "") {
5
+ return "";
6
+ }
7
+ const firstChar = options?.locale ? value[0].toLocaleLowerCase(options.locale) : value[0].toLowerCase();
8
+ return firstChar + value.slice(1);
9
+ }, "lowerFirst");
10
+
11
+ export { lowerFirst as default };
@@ -0,0 +1,11 @@
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 noCase = /* @__PURE__ */ __name((value, options) => case_kebabCase.kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: " " }), "noCase");
10
+
11
+ module.exports = noCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, N as NoCase } from '../packem_shared/types-D2-6p7t1.cjs';
2
+ import '../packem_shared/types-BNbQJg02.cjs';
3
+ import '../utils.cjs';
4
+
5
+ declare const noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
6
+
7
+ export = noCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, N as NoCase } from '../packem_shared/types-BAd3WDHo.mjs';
2
+ import '../packem_shared/types-BNbQJg02.mjs';
3
+ import '../utils.mjs';
4
+
5
+ declare const noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
6
+
7
+ export { noCase as default };
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, N as NoCase } from '../packem_shared/types-BttWSSIk.js';
2
+ import '../packem_shared/types-BNbQJg02.js';
3
+ import '../utils.js';
4
+
5
+ declare const noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
6
+
7
+ export = noCase;
@@ -0,0 +1,9 @@
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 noCase = /* @__PURE__ */ __name((value, options) => kebabCase(value, { cacheStore: defaultCacheStore, ...options, joiner: " " }), "noCase");
8
+
9
+ export { noCase as default };
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ const constants = require('../packem_shared/constants-HevSYUjU.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-BH1CT4dK.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 pascalCase = /* @__PURE__ */ __name((value, options) => {
15
+ if (typeof value !== "string" || !value) {
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 result = joinSegments(
28
+ case_splitByCase.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 && 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.toLowerCase(), { locale: options?.locale });
43
+ }),
44
+ ""
45
+ );
46
+ if (shouldCache && cacheKey) {
47
+ cacheStore.set(cacheKey, result);
48
+ }
49
+ return result;
50
+ }, "pascalCase");
51
+
52
+ module.exports = pascalCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, P as PascalCase } from '../packem_shared/types-D2-6p7t1.cjs';
2
+ import '../packem_shared/types-BNbQJg02.cjs';
3
+ import '../utils.cjs';
4
+
5
+ declare const pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
6
+
7
+ export = pascalCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, P as PascalCase } from '../packem_shared/types-BAd3WDHo.mjs';
2
+ import '../packem_shared/types-BNbQJg02.mjs';
3
+ import '../utils.mjs';
4
+
5
+ declare const pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
6
+
7
+ export { pascalCase as default };
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, P as PascalCase } from '../packem_shared/types-BttWSSIk.js';
2
+ import '../packem_shared/types-BNbQJg02.js';
3
+ import '../utils.js';
4
+
5
+ declare const pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
6
+
7
+ export = pascalCase;
@@ -0,0 +1,50 @@
1
+ import { R as RE_FAST_ANSI } from '../packem_shared/constants-BnVGLrDr.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-BHY8PPnk.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 pascalCase = /* @__PURE__ */ __name((value, options) => {
13
+ if (typeof value !== "string" || !value) {
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 result = joinSegments(
26
+ splitByCase(value, {
27
+ handleAnsi: options?.handleAnsi,
28
+ handleEmoji: options?.handleEmoji,
29
+ knownAcronyms: options?.knownAcronyms,
30
+ locale: options?.locale,
31
+ normalize: options?.normalize,
32
+ separators: void 0,
33
+ stripAnsi: options?.stripAnsi,
34
+ stripEmoji: options?.stripEmoji
35
+ }).map((word) => {
36
+ if (options?.handleAnsi && 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.toLowerCase(), { locale: options?.locale });
41
+ }),
42
+ ""
43
+ );
44
+ if (shouldCache && cacheKey) {
45
+ cacheStore.set(cacheKey, result);
46
+ }
47
+ return result;
48
+ }, "pascalCase");
49
+
50
+ export { pascalCase as default };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ const LRUCache = require('../packem_shared/LRUCache-Crb-m7cw.cjs');
4
+ const case_noCase = require('./no-case.cjs');
5
+ const case_upperFirst = require('./upper-first.cjs');
6
+ const generateCacheKey = require('../packem_shared/generate-cache-key-D8f1auDB.cjs');
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ const defaultCacheStore = new LRUCache(1e3);
11
+ const pascalSnakeCase = /* @__PURE__ */ __name((value, options) => {
12
+ if (typeof value !== "string") {
13
+ return "";
14
+ }
15
+ const shouldCache = options?.cache ?? false;
16
+ const cacheStore = options?.cacheStore ?? defaultCacheStore;
17
+ let cacheKey;
18
+ if (shouldCache) {
19
+ cacheKey = generateCacheKey.generateCacheKey(value, options);
20
+ }
21
+ if (shouldCache && cacheKey && cacheStore.has(cacheKey)) {
22
+ return cacheStore.get(cacheKey);
23
+ }
24
+ const words = case_noCase(value, { ...options, cache: false }).split(" ");
25
+ const result = words.map((word) => case_upperFirst(word, { locale: options?.locale })).join("_");
26
+ if (shouldCache && cacheKey) {
27
+ cacheStore.set(cacheKey, result);
28
+ }
29
+ return result;
30
+ }, "pascalSnakeCase");
31
+
32
+ module.exports = pascalSnakeCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-D2-6p7t1.cjs';
2
+ import '../packem_shared/types-BNbQJg02.cjs';
3
+ import '../utils.cjs';
4
+
5
+ declare const pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
6
+
7
+ export = pascalSnakeCase;
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-BAd3WDHo.mjs';
2
+ import '../packem_shared/types-BNbQJg02.mjs';
3
+ import '../utils.mjs';
4
+
5
+ declare const pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
6
+
7
+ export { pascalSnakeCase as default };
@@ -0,0 +1,7 @@
1
+ import { b as CaseOptions, f as PascalSnakeCase } from '../packem_shared/types-BttWSSIk.js';
2
+ import '../packem_shared/types-BNbQJg02.js';
3
+ import '../utils.js';
4
+
5
+ declare const pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
6
+
7
+ export = pascalSnakeCase;