@visulima/string 3.0.0 → 3.1.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 (69) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/align-text.d.ts +29 -29
  3. package/dist/case/camel-case.d.ts +16 -16
  4. package/dist/case/camel-case.js +1 -1
  5. package/dist/case/capital-case.d.ts +13 -13
  6. package/dist/case/capital-case.js +1 -1
  7. package/dist/case/constant-case.d.ts +13 -13
  8. package/dist/case/dot-case.d.ts +13 -13
  9. package/dist/case/flat-case.d.ts +11 -11
  10. package/dist/case/flip-case.d.ts +14 -14
  11. package/dist/case/flip-case.js +1 -1
  12. package/dist/case/identify-case.d.ts +14 -14
  13. package/dist/case/index.d.ts +7 -7
  14. package/dist/case/kebab-case.d.ts +22 -22
  15. package/dist/case/kebab-case.js +1 -1
  16. package/dist/case/lower-first.d.ts +12 -12
  17. package/dist/case/no-case.d.ts +13 -13
  18. package/dist/case/pascal-case.d.ts +16 -16
  19. package/dist/case/pascal-case.js +1 -1
  20. package/dist/case/pascal-snake-case.d.ts +13 -13
  21. package/dist/case/pascal-snake-case.js +1 -1
  22. package/dist/case/path-case.d.ts +13 -13
  23. package/dist/case/sentence-case.d.ts +13 -13
  24. package/dist/case/sentence-case.js +1 -1
  25. package/dist/case/snake-case.d.ts +13 -13
  26. package/dist/case/split-by-case.d.ts +20 -20
  27. package/dist/case/split-by-case.js +1 -1
  28. package/dist/case/title-case.d.ts +11 -11
  29. package/dist/case/title-case.js +1 -1
  30. package/dist/case/train-case.d.ts +13 -13
  31. package/dist/case/train-case.js +1 -1
  32. package/dist/case/upper-first.d.ts +12 -12
  33. package/dist/closest-string.d.ts +28 -28
  34. package/dist/compare-similarity.d.ts +33 -33
  35. package/dist/count-occurrences.d.ts +6 -6
  36. package/dist/direction.d.ts +4 -4
  37. package/dist/east-asian-width.d.ts +20 -14
  38. package/dist/excerpt.d.ts +18 -18
  39. package/dist/get-string-truncated-width.d.ts +131 -131
  40. package/dist/get-string-truncated-width.js +1 -1
  41. package/dist/get-string-width.d.ts +56 -56
  42. package/dist/indent.d.ts +8 -7
  43. package/dist/index.d.ts +2 -2
  44. package/dist/is-fullwidth-code-point.d.ts +4 -4
  45. package/dist/levenshtein.d.ts +19 -19
  46. package/dist/native-string-types.d.ts +212 -228
  47. package/dist/outdent.d.ts +64 -64
  48. package/dist/packem_shared/generate-cache-key-B_0X7MKm.js +1 -0
  49. package/dist/packem_shared/strip-vt-control-characters-BW1RglLp.js +1 -0
  50. package/dist/packem_shared/types.d-CMNqA5bi.d.ts +402 -0
  51. package/dist/packem_shared/types.d-LgsTR37y.d.ts +360 -0
  52. package/dist/replace-string.d.ts +7 -7
  53. package/dist/slice.d.ts +38 -38
  54. package/dist/slice.js +1 -1
  55. package/dist/slugify.d.ts +9 -9
  56. package/dist/test/utils.d.ts +14 -14
  57. package/dist/test/utils.js +11 -11
  58. package/dist/test/vitest.d.ts +2 -2
  59. package/dist/transliterate.d.ts +7 -7
  60. package/dist/transliterate.js +2 -2
  61. package/dist/truncate.d.ts +37 -37
  62. package/dist/utilities.d.ts +23 -23
  63. package/dist/word-similarity-sort.d.ts +32 -32
  64. package/dist/word-wrap.d.ts +33 -33
  65. package/dist/word-wrap.js +7 -7
  66. package/package.json +1 -1
  67. package/dist/packem_shared/generate-cache-key-BqU1Cqwm.js +0 -1
  68. package/dist/packem_shared/types.d-CmNvyl4l.d.ts +0 -360
  69. package/dist/packem_shared/types.d-fhe030jX.d.ts +0 -402
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## @visulima/string [3.1.0](https://github.com/visulima/visulima/compare/%40visulima%2Fstring%403.0.0...%40visulima%2Fstring%403.1.0) (2026-08-02)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/colorize:** upgraded to 2.1.0
7
+
1
8
  ## @visulima/string [3.0.0](https://github.com/visulima/visulima/compare/@visulima/string@2.0.6...@visulima/string@3.0.0) (2026-07-03)
2
9
 
3
10
  ### ⚠ BREAKING CHANGES
@@ -1,45 +1,45 @@
1
1
  import { StringWidthOptions } from "./get-string-width.js";
2
2
  import "./get-string-truncated-width.js";
3
3
  /**
4
- * Options for controlling the text alignment.
5
- */
4
+ * Options for controlling the text alignment.
5
+ */
6
6
  type AlignTextOptions = {
7
7
  /**
8
- * The alignment direction.
9
- * @default "center"
10
- */
8
+ * The alignment direction.
9
+ * @default "center"
10
+ */
11
11
  align?: "center" | "left" | "right";
12
12
  /**
13
- * Character used for padding when aligning text.
14
- * @default " "
15
- */
13
+ * Character used for padding when aligning text.
14
+ * @default " "
15
+ */
16
16
  pad?: string;
17
17
  /**
18
- * The character to split the input string by, if it's a single string.
19
- * @default "\n"
20
- */
18
+ * The character to split the input string by, if it's a single string.
19
+ * @default "\n"
20
+ */
21
21
  split?: string;
22
22
  /**
23
- * Options to pass to `getStringWidth` for calculating the width of each line.
24
- */
23
+ * Options to pass to `getStringWidth` for calculating the width of each line.
24
+ */
25
25
  stringWidthOptions?: StringWidthOptions;
26
26
  };
27
27
  /**
28
- * Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
29
- * @example
30
- * ```typescript
31
- * alignText("Hello\nWorld!", { align: "right" });
32
- * // => " Hello\nWorld!"
33
- *
34
- * alignText(["Beep", "Boop\nBop"], { align: "center" });
35
- * // => [
36
- * // " Beep",
37
- * // "Boop\n Bop"
38
- * // ]
39
- * ```
40
- * @param text The string or array of strings to align.
41
- * @param options Options for controlling the alignment.
42
- * @returns The aligned string or array of strings, matching the input type.
43
- */
28
+ * Aligns text (including multi-line strings with ANSI escape codes) to the left, center, or right.
29
+ * @example
30
+ * ```typescript
31
+ * alignText("Hello\nWorld!", { align: "right" });
32
+ * // => " Hello\nWorld!"
33
+ *
34
+ * alignText(["Beep", "Boop\nBop"], { align: "center" });
35
+ * // => [
36
+ * // " Beep",
37
+ * // "Boop\n Bop"
38
+ * // ]
39
+ * ```
40
+ * @param text The string or array of strings to align.
41
+ * @param options Options for controlling the alignment.
42
+ * @returns The aligned string or array of strings, matching the input type.
43
+ */
44
44
  declare const alignText: (text: string[] | string, options?: AlignTextOptions) => string[] | string;
45
45
  export { AlignTextOptions, alignText };
@@ -1,19 +1,19 @@
1
- import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, C as CamelCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to camelCase.
5
- * @param value The string to convert.
6
- * @param options Options for case conversion.
7
- * @returns The string in camelCase.
8
- * @example
9
- * ```typescript
10
- * camelCase('foo bar') // 'fooBar'
11
- * camelCase('foo-bar') // 'fooBar'
12
- * camelCase('foo_bar') // 'fooBar'
13
- * camelCase('XMLHttpRequest') // 'xmlHttpRequest'
14
- * camelCase('AJAXRequest') // 'ajaxRequest'
15
- * camelCase('QueryXML123String') // 'queryXml123String'
16
- * ```
17
- */
4
+ * Converts a string to camelCase.
5
+ * @param value The string to convert.
6
+ * @param options Options for case conversion.
7
+ * @returns The string in camelCase.
8
+ * @example
9
+ * ```typescript
10
+ * camelCase('foo bar') // 'fooBar'
11
+ * camelCase('foo-bar') // 'fooBar'
12
+ * camelCase('foo_bar') // 'fooBar'
13
+ * camelCase('XMLHttpRequest') // 'xmlHttpRequest'
14
+ * camelCase('AJAXRequest') // 'ajaxRequest'
15
+ * camelCase('QueryXML123String') // 'queryXml123String'
16
+ * ```
17
+ */
18
18
  declare const camelCase: <T extends string = string>(value?: T, options?: CaseOptions) => CamelCase<T>;
19
19
  export { camelCase as default };
@@ -1 +1 @@
1
- import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import f from"./lower-first.js";import{splitByCase as A}from"./split-by-case.js";import h from"./upper-first.js";import{n as d}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import u from"../packem_shared/joinSegments-CaHT-45s.js";import{a as w}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const y=new p(1e3),_=(t,o)=>{if(typeof t!="string"||!t)return"";const i=o?.cache??!1,n=o?.cacheStore??y;let r;if(i&&(r=d(t,o)),i&&r&&n.has(r))return n.get(r);let a=!0;const e=u(A(t,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(s=>{if(o?.handleAnsi&&c.test(s))return s;const m=o?.locale?.startsWith("de")?w(s):s,l=o?.locale?m.toLocaleLowerCase(o.locale):m.toLowerCase();return a?(a=!1,f(l,o)):h(l,o)}),"");return i&&r&&n.set(r,e),e};export{_ as default};
1
+ import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as p}from"../packem_shared/lru-cache-BtMSrYQJ.js";import f from"./lower-first.js";import{splitByCase as A}from"./split-by-case.js";import h from"./upper-first.js";import{a as d}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import u from"../packem_shared/joinSegments-CaHT-45s.js";import{a as w}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const y=new p(1e3),z=(t,o)=>{if(typeof t!="string"||!t)return"";const i=o?.cache??!1,n=o?.cacheStore??y;let r;if(i&&(r=d(t,o)),i&&r&&n.has(r))return n.get(r);let a=!0;const e=u(A(t,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(s=>{if(o?.handleAnsi&&c.test(s))return s;const m=o?.locale?.startsWith("de")?w(s):s,l=o?.locale?m.toLocaleLowerCase(o.locale):m.toLowerCase();return a?(a=!1,f(l,o)):h(l,o)}),"");return i&&r&&n.set(r,e),e};export{z as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, a as CapitalCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to Capital Case.
5
- * @example
6
- * ```typescript
7
- * capitalCase("foo bar") // => "Foo Bar"
8
- * capitalCase("foo-bar") // => "Foo Bar"
9
- * capitalCase("foo_bar") // => "Foo Bar"
10
- * capitalCase("XMLHttpRequest") // => "Xml Http Request"
11
- * capitalCase("AJAXRequest") // => "Ajax Request"
12
- * capitalCase("QueryXML123String") // => "Query Xml 123 String"
13
- * ```
14
- */
4
+ * Converts a string to Capital Case.
5
+ * @example
6
+ * ```typescript
7
+ * capitalCase("foo bar") // => "Foo Bar"
8
+ * capitalCase("foo-bar") // => "Foo Bar"
9
+ * capitalCase("foo_bar") // => "Foo Bar"
10
+ * capitalCase("XMLHttpRequest") // => "Xml Http Request"
11
+ * capitalCase("AJAXRequest") // => "Ajax Request"
12
+ * capitalCase("QueryXML123String") // => "Query Xml 123 String"
13
+ * ```
14
+ */
15
15
  declare const capitalCase: <T extends string = string>(value?: T, options?: CaseOptions) => CapitalCase<T>;
16
16
  export { capitalCase as default };
@@ -1 +1 @@
1
- import{c as m}from"../packem_shared/constants-aPzGW29R.js";import{i as c}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{n as h}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import A from"../packem_shared/joinSegments-CaHT-45s.js";import{a as d}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const u=new c(1e3),S=(s,o)=>{if(typeof s!="string")return"";const i=o?.cache??!1,a=o?.cacheStore??u;let r;if(i&&(r=h(s,o)),i&&r&&a.has(r))return a.get(r);const l=p(s,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(t=>{if(m.test(t))return t;const e=o?.locale?.startsWith("de")?d(t):t;return f(o?.locale?e.toLocaleLowerCase(o.locale):e.toLocaleLowerCase(),o)}),n=A(l," ");return i&&r&&a.set(r,n),n};export{S as default};
1
+ import{c as m}from"../packem_shared/constants-aPzGW29R.js";import{i as c}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{a as h}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import A from"../packem_shared/joinSegments-CaHT-45s.js";import{a as d}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const u=new c(1e3),S=(a,o)=>{if(typeof a!="string")return"";const s=o?.cache??!1,i=o?.cacheStore??u;let r;if(s&&(r=h(a,o)),s&&r&&i.has(r))return i.get(r);const l=p(a,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(t=>{if(m.test(t))return t;const e=o?.locale?.startsWith("de")?d(t):t;return f(o?.locale?e.toLocaleLowerCase(o.locale):e.toLocaleLowerCase(),o)}),n=A(l," ");return s&&r&&i.set(r,n),n};export{S as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to CONSTANT_CASE.
5
- * @example
6
- * ```typescript
7
- * constantCase("foo bar") // => "FOO_BAR"
8
- * constantCase("foo-bar") // => "FOO_BAR"
9
- * constantCase("foo_bar") // => "FOO_BAR"
10
- * constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
11
- * constantCase("AJAXRequest") // => "AJAX_REQUEST"
12
- * constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
13
- * ```
14
- */
4
+ * Converts a string to CONSTANT_CASE.
5
+ * @example
6
+ * ```typescript
7
+ * constantCase("foo bar") // => "FOO_BAR"
8
+ * constantCase("foo-bar") // => "FOO_BAR"
9
+ * constantCase("foo_bar") // => "FOO_BAR"
10
+ * constantCase("XMLHttpRequest") // => "XML_HTTP_REQUEST"
11
+ * constantCase("AJAXRequest") // => "AJAX_REQUEST"
12
+ * constantCase("QueryXML123String") // => "QUERY_XML_123_STRING"
13
+ * ```
14
+ */
15
15
  declare const constantCase: <T extends string = string>(value?: T, options?: CaseOptions) => ConstantCase<T>;
16
16
  export { constantCase as default };
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, D as DotCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to dot.case.
5
- * @example
6
- * ```typescript
7
- * dotCase("foo bar") // => "foo.bar"
8
- * dotCase("foo-bar") // => "foo.bar"
9
- * dotCase("foo_bar") // => "foo.bar"
10
- * dotCase("XMLHttpRequest") // => "xml.http.request"
11
- * dotCase("AJAXRequest") // => "ajax.request"
12
- * dotCase("QueryXML123String") // => "query.xml.123.string"
13
- * ```
14
- */
4
+ * Converts a string to dot.case.
5
+ * @example
6
+ * ```typescript
7
+ * dotCase("foo bar") // => "foo.bar"
8
+ * dotCase("foo-bar") // => "foo.bar"
9
+ * dotCase("foo_bar") // => "foo.bar"
10
+ * dotCase("XMLHttpRequest") // => "xml.http.request"
11
+ * dotCase("AJAXRequest") // => "ajax.request"
12
+ * dotCase("QueryXML123String") // => "query.xml.123.string"
13
+ * ```
14
+ */
15
15
  declare const dotCase: <T extends string = string>(value?: T, options?: CaseOptions) => DotCase<T>;
16
16
  export { dotCase as default };
@@ -1,14 +1,14 @@
1
- import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, F as FlatCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to flat case (all lowercase, no separators).
5
- * @example
6
- * ```typescript
7
- * flatCase("foo-barBaz") // => "foobarbaz"
8
- * flatCase("XMLHttpRequest") // => "xmlhttprequest"
9
- * flatCase("AJAXRequest") // => "ajaxrequest"
10
- * flatCase("QueryXML123String") // => "queryxml123string"
11
- * ```
12
- */
4
+ * Converts a string to flat case (all lowercase, no separators).
5
+ * @example
6
+ * ```typescript
7
+ * flatCase("foo-barBaz") // => "foobarbaz"
8
+ * flatCase("XMLHttpRequest") // => "xmlhttprequest"
9
+ * flatCase("AJAXRequest") // => "ajaxrequest"
10
+ * flatCase("QueryXML123String") // => "queryxml123string"
11
+ * ```
12
+ */
13
13
  declare const flatCase: <T extends string = string>(value?: T, options?: CaseOptions) => FlatCase<T>;
14
14
  export { flatCase as default };
@@ -1,19 +1,19 @@
1
- import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, d as FlipCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Options specific to flip case operations.
5
- * Note: handleEmoji is not needed as the function preserves emojis by default
6
- */
4
+ * Options specific to flip case operations.
5
+ * Note: handleEmoji is not needed as the function preserves emojis by default
6
+ */
7
7
  type FlipOptions = Omit<CaseOptions, "handleEmoji">;
8
8
  /**
9
- * Flips the case of each character in a string.
10
- * @example
11
- * ```typescript
12
- * flipCase("FooBar") // => "fOObAR"
13
- * flipCase("foobar") // => "FOOBAR"
14
- * flipCase("FOOBAR") // => "foobar"
15
- * flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
16
- * ```
17
- */
9
+ * Flips the case of each character in a string.
10
+ * @example
11
+ * ```typescript
12
+ * flipCase("FooBar") // => "fOObAR"
13
+ * flipCase("foobar") // => "FOOBAR"
14
+ * flipCase("FOOBAR") // => "foobar"
15
+ * flipCase("XMLHttpRequest") // => "xmlhTTPrEQUEST"
16
+ * ```
17
+ */
18
18
  declare const flipCase: <T extends string = string>(value?: T, options?: FlipOptions) => FlipCase<T>;
19
19
  export { FlipOptions, flipCase };
@@ -1 +1 @@
1
- import{createRequire as m}from"node:module";import{s as _}from"../packem_shared/constants-aPzGW29R.js";import{i as j}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{n as C}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";const h=m(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,n]=l.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return l.getBuiltinModule(s)}return h(s)},{stripVTControlCharacters:g}=d("node:util"),b=new j(1e3),v=(s,e)=>{if(typeof s!="string"||s.length===0)return"";const n=e?.cache??!1,a=e?.cacheStore??b;let r;if(n&&(r=C(s,e)),n&&r&&a.has(r))return a.get(r);let o=s;e?.stripEmoji&&(o=_(o)),e?.stripAnsi&&(o=g(o));let c="",t=0;for(;t<o.length;){if(e?.handleAnsi&&o[t]==="\x1B"){let f=o[t];for(t+=1;t<o.length&&o[t]!=="m";)f+=o[t],t+=1;t<o.length&&(f+=o[t],c+=f),t+=1;continue}const i=o[t],u=e?.locale?i.toLocaleLowerCase(e.locale):i.toLowerCase();let p;i===u?p=e?.locale?i.toLocaleUpperCase(e.locale):i.toUpperCase():p=u,c+=p,t+=1}return n&&r&&a.set(r,c),c};export{v as flipCase};
1
+ import{s as m}from"../packem_shared/constants-aPzGW29R.js";import{i as h}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{r as g}from"../packem_shared/strip-vt-control-characters-BW1RglLp.js";import{a as C}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const u=new h(1e3),x=(i,o)=>{if(typeof i!="string"||i.length===0)return"";const r=o?.cache??!1,c=o?.cacheStore??u;let l;if(r&&(l=C(i,o)),r&&l&&c.has(l))return c.get(l);let e=i;o?.stripEmoji&&(e=m(e)),o?.stripAnsi&&(e=g(e));let n="",t=0;for(;t<e.length;){if(o?.handleAnsi&&e[t]==="\x1B"){let p=e[t];for(t+=1;t<e.length&&e[t]!=="m";)p+=e[t],t+=1;t<e.length&&(p+=e[t],n+=p),t+=1;continue}const s=e[t],f=o?.locale?s.toLocaleLowerCase(o.locale):s.toLowerCase();let a;s===f?a=o?.locale?s.toLocaleUpperCase(o.locale):s.toUpperCase():a=f,n+=a,t+=1}return r&&l&&c.set(l,n),n};export{x as flipCase};
@@ -1,17 +1,17 @@
1
- import { I as IdentifyCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { I as IdentifyCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Identifies the case style of a string.
5
- * @example
6
- * ```typescript
7
- * identifyCase("fooBar") // => "camel"
8
- * identifyCase("FooBar") // => "pascal"
9
- * identifyCase("foo_bar") // => "snake"
10
- * identifyCase("foo-bar") // => "kebab"
11
- * identifyCase("foo") // => "lower"
12
- * identifyCase("FOO") // => "upper"
13
- * identifyCase("FooBAR") // => "mixed"
14
- * ```
15
- */
4
+ * Identifies the case style of a string.
5
+ * @example
6
+ * ```typescript
7
+ * identifyCase("fooBar") // => "camel"
8
+ * identifyCase("FooBar") // => "pascal"
9
+ * identifyCase("foo_bar") // => "snake"
10
+ * identifyCase("foo-bar") // => "kebab"
11
+ * identifyCase("foo") // => "lower"
12
+ * identifyCase("FOO") // => "upper"
13
+ * identifyCase("FooBAR") // => "mixed"
14
+ * ```
15
+ */
16
16
  declare const identifyCase: <T extends string = string>(value?: T) => IdentifyCase<T>;
17
17
  export { identifyCase as default };
@@ -1,4 +1,4 @@
1
- export type { N as NodeLocale } from "../packem_shared/types.d-CmNvyl4l.js";
1
+ export type { N as NodeLocale } from "../packem_shared/types.d-LgsTR37y.js";
2
2
  export { default as camelCase } from "./camel-case.js";
3
3
  export { default as capitalCase } from "./capital-case.js";
4
4
  export { default as constantCase } from "./constant-case.js";
@@ -17,13 +17,13 @@ export { default as snakeCase } from "./snake-case.js";
17
17
  export { type SplitOptions, splitByCase } from "./split-by-case.js";
18
18
  export { default as titleCase } from "./title-case.js";
19
19
  export { default as trainCase } from "./train-case.js";
20
- export type { 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.d-fhe030jX.js";
20
+ export type { 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.d-CMNqA5bi.js";
21
21
  export { default as upperFirst } from "./upper-first.js";
22
22
  /**
23
- * Joins segments with a joiner, handling ANSI sequences and emojis correctly.
24
- * @param segments Array of segments to join
25
- * @param joiner String used to join segments together
26
- * @returns Joined string with proper handling of ANSI and emoji sequences
27
- */
23
+ * Joins segments with a joiner, handling ANSI sequences and emojis correctly.
24
+ * @param segments Array of segments to join
25
+ * @param joiner String used to join segments together
26
+ * @returns Joined string with proper handling of ANSI and emoji sequences
27
+ */
28
28
  declare const joinSegments: (segments: string[], joiner: string) => string;
29
29
  export { joinSegments };
@@ -1,31 +1,31 @@
1
- import { b as CaseOptions, K as KebabCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, K as KebabCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  interface KebabCaseOptions extends CaseOptions {
4
4
  /**
5
- * String used to join words together in kebab case format.
6
- * @default "-"
7
- */
5
+ * String used to join words together in kebab case format.
6
+ * @default "-"
7
+ */
8
8
  joiner?: string;
9
9
  /**
10
- * Whether to convert the result to uppercase.
11
- * @default false
12
- */
10
+ * Whether to convert the result to uppercase.
11
+ * @default false
12
+ */
13
13
  toUpperCase?: boolean;
14
14
  }
15
15
  /**
16
- * Converts a string to kebab-case.
17
- * @param value The string to convert to kebab-case.
18
- * @param options Configuration options for kebab-case conversion.
19
- * @returns The converted kebab-case string.
20
- * @example
21
- * ```typescript
22
- * kebabCase("fooBar") // => "foo-bar"
23
- * kebabCase("foo bar") // => "foo-bar"
24
- * kebabCase("foo_bar") // => "foo-bar"
25
- * kebabCase("XMLHttpRequest") // => "xml-http-request"
26
- * kebabCase("AJAXRequest") // => "ajax-request"
27
- * kebabCase("QueryXML123String") // => "query-xml-123-string"
28
- * ```
29
- */
16
+ * Converts a string to kebab-case.
17
+ * @param value The string to convert to kebab-case.
18
+ * @param options Configuration options for kebab-case conversion.
19
+ * @returns The converted kebab-case string.
20
+ * @example
21
+ * ```typescript
22
+ * kebabCase("fooBar") // => "foo-bar"
23
+ * kebabCase("foo bar") // => "foo-bar"
24
+ * kebabCase("foo_bar") // => "foo-bar"
25
+ * kebabCase("XMLHttpRequest") // => "xml-http-request"
26
+ * kebabCase("AJAXRequest") // => "ajax-request"
27
+ * kebabCase("QueryXML123String") // => "query-xml-123-string"
28
+ * ```
29
+ */
30
30
  declare const kebabCase: <T extends string = string>(value?: T, options?: KebabCaseOptions) => KebabCase<T>;
31
31
  export { KebabCaseOptions, kebabCase };
@@ -1 +1 @@
1
- import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import{n as f}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(s,o)=>{if(typeof s!="string")return"";const n=o?.cache??!1,e=o?.cacheStore??d;let r;if(n&&(r=f(s,o)),n&&r&&e.has(r))return e.get(r);const l=p(s,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(t=>{if(o?.handleAnsi&&c.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const a=o?.locale?.startsWith("de")?A(t):t;return o?.locale?a.toLocaleLowerCase(o.locale):a.toLowerCase()}),i=h(l,o?.joiner??"-");return n&&r&&e.set(r,i),i};export{L as kebabCase};
1
+ import{c}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as p}from"./split-by-case.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(s,o)=>{if(typeof s!="string")return"";const e=o?.cache??!1,n=o?.cacheStore??d;let r;if(e&&(r=f(s,o)),e&&r&&n.has(r))return n.get(r);const l=p(s,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(t=>{if(o?.handleAnsi&&c.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?A(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),a=h(l,o?.joiner??"-");return e&&r&&n.set(r,a),a};export{L as kebabCase};
@@ -1,15 +1,15 @@
1
- import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts first character to lower case.
5
- * @param value The string to convert.
6
- * @param options Options for case conversion.
7
- * @returns The string with its first character converted to lowercase.
8
- * @example
9
- * ```typescript
10
- * lowerFirst("Hello world!") // => "hello world!"
11
- * lowerFirst("İSTANBUL", { locale: "tr" }) // => "istanbul"
12
- * ```
13
- */
4
+ * Converts first character to lower case.
5
+ * @param value The string to convert.
6
+ * @param options Options for case conversion.
7
+ * @returns The string with its first character converted to lowercase.
8
+ * @example
9
+ * ```typescript
10
+ * lowerFirst("Hello world!") // => "hello world!"
11
+ * lowerFirst("İSTANBUL", { locale: "tr" }) // => "istanbul"
12
+ * ```
13
+ */
14
14
  declare const lowerFirst: <T extends string = string>(value?: T, options?: LocaleOptions) => LowerFirst<T>;
15
15
  export { lowerFirst as default };
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, N as NoCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, N as NoCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to no case (space separated words).
5
- * @example
6
- * ```typescript
7
- * noCase("foo bar") // => "foo bar"
8
- * noCase("foo-bar") // => "foo bar"
9
- * noCase("foo_bar") // => "foo bar"
10
- * noCase("XMLHttpRequest") // => "xml http request"
11
- * noCase("AJAXRequest") // => "ajax request"
12
- * noCase("QueryXML123String") // => "query xml 123 string"
13
- * ```
14
- */
4
+ * Converts a string to no case (space separated words).
5
+ * @example
6
+ * ```typescript
7
+ * noCase("foo bar") // => "foo bar"
8
+ * noCase("foo-bar") // => "foo bar"
9
+ * noCase("foo_bar") // => "foo bar"
10
+ * noCase("XMLHttpRequest") // => "xml http request"
11
+ * noCase("AJAXRequest") // => "ajax request"
12
+ * noCase("QueryXML123String") // => "query xml 123 string"
13
+ * ```
14
+ */
15
15
  declare const noCase: <T extends string = string>(value?: T, options?: CaseOptions) => NoCase<T>;
16
16
  export { noCase as default };
@@ -1,19 +1,19 @@
1
- import { b as CaseOptions, P as PascalCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, P as PascalCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to PascalCase.
5
- * @param value The string to convert.
6
- * @param options Options for case conversion.
7
- * @returns The string in PascalCase.
8
- * @example
9
- * ```typescript
10
- * pascalCase('foo bar') // 'FooBar'
11
- * pascalCase('foo-bar') // 'FooBar'
12
- * pascalCase('foo_bar') // 'FooBar'
13
- * pascalCase('XMLHttpRequest') // 'XmlHttpRequest'
14
- * pascalCase('AJAXRequest') // 'AjaxRequest'
15
- * pascalCase('QueryXML123String') // 'QueryXml123String'
16
- * ```
17
- */
4
+ * Converts a string to PascalCase.
5
+ * @param value The string to convert.
6
+ * @param options Options for case conversion.
7
+ * @returns The string in PascalCase.
8
+ * @example
9
+ * ```typescript
10
+ * pascalCase('foo bar') // 'FooBar'
11
+ * pascalCase('foo-bar') // 'FooBar'
12
+ * pascalCase('foo_bar') // 'FooBar'
13
+ * pascalCase('XMLHttpRequest') // 'XmlHttpRequest'
14
+ * pascalCase('AJAXRequest') // 'AjaxRequest'
15
+ * pascalCase('QueryXML123String') // 'QueryXml123String'
16
+ * ```
17
+ */
18
18
  declare const pascalCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalCase<T>;
19
19
  export { pascalCase as default };
@@ -1 +1 @@
1
- import{c as e}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import p from"./upper-first.js";import{n as f}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(t,o)=>{if(typeof t!="string"||!t)return"";const n=o?.cache??!1,i=o?.cacheStore??d;let r;if(n&&(r=f(t,o)),n&&r&&i.has(r))return i.get(r);const a=h(c(t,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(s=>{if(o?.handleAnsi&&e.test(s))return s;const l=o?.locale?.startsWith("de")?A(s):s;return p(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}),"");return n&&r&&i.set(r,a),a};export{L as default};
1
+ import{c as e}from"../packem_shared/constants-aPzGW29R.js";import{i as m}from"../packem_shared/lru-cache-BtMSrYQJ.js";import{splitByCase as c}from"./split-by-case.js";import p from"./upper-first.js";import{a as f}from"../packem_shared/generate-cache-key-B_0X7MKm.js";import h from"../packem_shared/joinSegments-CaHT-45s.js";import{a as A}from"../packem_shared/normalize-german-eszett-hNMwtGjd.js";const d=new m(1e3),L=(t,o)=>{if(typeof t!="string"||!t)return"";const a=o?.cache??!1,i=o?.cacheStore??d;let r;if(a&&(r=f(t,o)),a&&r&&i.has(r))return i.get(r);const n=h(c(t,{handleAnsi:o?.handleAnsi,handleEmoji:o?.handleEmoji,knownAcronyms:o?.knownAcronyms,locale:o?.locale,normalize:o?.normalize,separators:void 0,stripAnsi:o?.stripAnsi,stripEmoji:o?.stripEmoji}).map(s=>{if(o?.handleAnsi&&e.test(s))return s;const l=o?.locale?.startsWith("de")?A(s):s;return p(o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase(),{locale:o?.locale})}),"");return a&&r&&i.set(r,n),n};export{L as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to Pascal_Snake_Case.
5
- * @example
6
- * ```typescript
7
- * pascalSnakeCase("foo bar") // => "Foo_Bar"
8
- * pascalSnakeCase("foo-bar") // => "Foo_Bar"
9
- * pascalSnakeCase("foo_bar") // => "Foo_Bar"
10
- * pascalSnakeCase("XMLHttpRequest") // => "Xml_Http_Request"
11
- * pascalSnakeCase("AJAXRequest") // => "Ajax_Request"
12
- * pascalSnakeCase("QueryXML123String") // => "Query_Xml_123_String"
13
- * ```
14
- */
4
+ * Converts a string to Pascal_Snake_Case.
5
+ * @example
6
+ * ```typescript
7
+ * pascalSnakeCase("foo bar") // => "Foo_Bar"
8
+ * pascalSnakeCase("foo-bar") // => "Foo_Bar"
9
+ * pascalSnakeCase("foo_bar") // => "Foo_Bar"
10
+ * pascalSnakeCase("XMLHttpRequest") // => "Xml_Http_Request"
11
+ * pascalSnakeCase("AJAXRequest") // => "Ajax_Request"
12
+ * pascalSnakeCase("QueryXML123String") // => "Query_Xml_123_String"
13
+ * ```
14
+ */
15
15
  declare const pascalSnakeCase: <T extends string = string>(value?: T, options?: CaseOptions) => PascalSnakeCase<T>;
16
16
  export { pascalSnakeCase as default };
@@ -1 +1 @@
1
- import{i as n}from"../packem_shared/lru-cache-BtMSrYQJ.js";import l from"./no-case.js";import m from"./upper-first.js";import{n as p}from"../packem_shared/generate-cache-key-BqU1Cqwm.js";const s=new n(1e3),d=(r,t)=>{if(typeof r!="string")return"";const o=t?.cache??!1,c=t?.cacheStore??s;let e;if(o&&(e=p(r,t)),o&&e&&c.has(e))return c.get(e);const f=l(r,{...t,cache:!1}).split(" ").map(i=>m(i,{locale:t?.locale})).join("_");return o&&e&&c.set(e,f),f};export{d as default};
1
+ import{i as l}from"../packem_shared/lru-cache-BtMSrYQJ.js";import m from"./no-case.js";import n from"./upper-first.js";import{a as p}from"../packem_shared/generate-cache-key-B_0X7MKm.js";const s=new l(1e3),d=(r,t)=>{if(typeof r!="string")return"";const o=t?.cache??!1,c=t?.cacheStore??s;let e;if(o&&(e=p(r,t)),o&&e&&c.has(e))return c.get(e);const f=m(r,{...t,cache:!1}).split(" ").map(i=>n(i,{locale:t?.locale})).join("_");return o&&e&&c.set(e,f),f};export{d as default};
@@ -1,16 +1,16 @@
1
- import { b as CaseOptions, g as PathCase } from "../packem_shared/types.d-fhe030jX.js";
2
- import "../packem_shared/types.d-CmNvyl4l.js";
1
+ import { b as CaseOptions, g as PathCase } from "../packem_shared/types.d-CMNqA5bi.js";
2
+ import "../packem_shared/types.d-LgsTR37y.js";
3
3
  /**
4
- * Converts a string to path/case.
5
- * @example
6
- * ```typescript
7
- * pathCase("foo bar") // => "foo/bar"
8
- * pathCase("foo-bar") // => "foo/bar"
9
- * pathCase("foo_bar") // => "foo/bar"
10
- * pathCase("XMLHttpRequest") // => "xml/http/request"
11
- * pathCase("AJAXRequest") // => "ajax/request"
12
- * pathCase("QueryXML123String") // => "query/xml/123/string"
13
- * ```
14
- */
4
+ * Converts a string to path/case.
5
+ * @example
6
+ * ```typescript
7
+ * pathCase("foo bar") // => "foo/bar"
8
+ * pathCase("foo-bar") // => "foo/bar"
9
+ * pathCase("foo_bar") // => "foo/bar"
10
+ * pathCase("XMLHttpRequest") // => "xml/http/request"
11
+ * pathCase("AJAXRequest") // => "ajax/request"
12
+ * pathCase("QueryXML123String") // => "query/xml/123/string"
13
+ * ```
14
+ */
15
15
  declare const pathCase: <T extends string = string>(value?: T, options?: CaseOptions) => PathCase<T>;
16
16
  export { pathCase as default };