@visulima/string 3.0.0-alpha.14 → 3.0.0-alpha.15

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 (52) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/case/camel-case.d.ts +3 -3
  3. package/dist/case/camel-case.js +1 -1
  4. package/dist/case/capital-case.d.ts +3 -3
  5. package/dist/case/capital-case.js +1 -1
  6. package/dist/case/constant-case.d.ts +3 -3
  7. package/dist/case/constant-case.js +1 -1
  8. package/dist/case/dot-case.d.ts +3 -3
  9. package/dist/case/dot-case.js +1 -1
  10. package/dist/case/flat-case.d.ts +3 -3
  11. package/dist/case/flat-case.js +1 -1
  12. package/dist/case/flip-case.d.ts +3 -3
  13. package/dist/case/flip-case.js +1 -1
  14. package/dist/case/identify-case.d.ts +3 -3
  15. package/dist/case/index.d.ts +3 -3
  16. package/dist/case/kebab-case.d.ts +3 -3
  17. package/dist/case/kebab-case.js +1 -1
  18. package/dist/case/lower-first.d.ts +3 -3
  19. package/dist/case/no-case.d.ts +3 -3
  20. package/dist/case/no-case.js +1 -1
  21. package/dist/case/pascal-case.d.ts +3 -3
  22. package/dist/case/pascal-case.js +1 -1
  23. package/dist/case/pascal-snake-case.d.ts +3 -3
  24. package/dist/case/pascal-snake-case.js +1 -1
  25. package/dist/case/path-case.d.ts +3 -3
  26. package/dist/case/path-case.js +1 -1
  27. package/dist/case/sentence-case.d.ts +3 -3
  28. package/dist/case/sentence-case.js +1 -1
  29. package/dist/case/snake-case.d.ts +3 -3
  30. package/dist/case/snake-case.js +1 -1
  31. package/dist/case/split-by-case.d.ts +3 -3
  32. package/dist/case/split-by-case.js +1 -1
  33. package/dist/case/title-case.d.ts +3 -3
  34. package/dist/case/title-case.js +1 -1
  35. package/dist/case/train-case.d.ts +3 -3
  36. package/dist/case/train-case.js +1 -1
  37. package/dist/case/upper-first.d.ts +3 -3
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +1 -1
  40. package/dist/packem_shared/LRUCache-Dpk7Vnfr.js +1 -0
  41. package/dist/packem_shared/{closestN-Vd5oNJy_.js → closestN-Daviv9V6.js} +1 -1
  42. package/dist/packem_shared/{lru-cache.d-BsP6kbVJ.d.ts → lru-cache.d-BVu2_gfi.d.ts} +0 -1
  43. package/dist/packem_shared/{types.d-CEMfJjRV.d.ts → types.d-NJ4vcG-A.d.ts} +1 -1
  44. package/dist/packem_shared/{types.d-BaFAOLxg.d.ts → types.d-XxhGlCLZ.d.ts} +2 -2
  45. package/dist/slice.js +1 -1
  46. package/dist/slugify.d.ts +1 -1
  47. package/dist/truncate.js +1 -1
  48. package/dist/utilities.d.ts +2 -2
  49. package/dist/utilities.js +1 -1
  50. package/dist/word-wrap.js +7 -7
  51. package/package.json +1 -1
  52. package/dist/packem_shared/LRUCache-Bjo6gsbC.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## @visulima/string [3.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/string@3.0.0-alpha.14...@visulima/string@3.0.0-alpha.15) (2026-06-04)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **string:** 3 bug fixes + 2 perf ([3591a75](https://github.com/visulima/visulima/commit/3591a75f8c9e5db4f990808d1c87fc3434d4acdf))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
10
+
11
+ ### Tests
12
+
13
+ * improve coverage across packages ([91bd6d3](https://github.com/visulima/visulima/commit/91bd6d3b61736e3c8bd1fc59b0b5955f76a5d323))
14
+ * **string:** cover utility helpers, case edge paths, replace/slice/wrap/truncate and ansi-parser branches ([f8f9340](https://github.com/visulima/visulima/commit/f8f934011945f120ab5fa21454d88652d7ef5d33))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.13
20
+
1
21
  ## @visulima/string [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/string@3.0.0-alpha.13...@visulima/string@3.0.0-alpha.14) (2026-05-27)
2
22
 
3
23
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, a as CamelCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, a as CamelCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to camelCase.
6
6
  * @param value The string to convert.
@@ -1 +1 @@
1
- var p=Object.defineProperty;var c=(r,o)=>p(r,"name",{value:o,configurable:!0});import{R as f}from"../packem_shared/constants-DmzZF6_u.js";import h from"../packem_shared/LRUCache-Bjo6gsbC.js";import u from"./lower-first.js";import{splitByCase as d}from"./split-by-case.js";import A from"./upper-first.js";import{a as E}from"../packem_shared/generate-cache-key-DPByFaMH.js";import j from"../packem_shared/joinSegments-D27SxoCV.js";import{l as w}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var y=Object.defineProperty,v=c((r,o)=>y(r,"name",{value:o,configurable:!0}),"o");const C=new h(1e3),x=v((r,o)=>{if(typeof r!="string"||!r)return"";const s=o?.cache??!1,a=o?.cacheStore??C;let t;if(s&&(t=E(r,o)),s&&t&&a.has(t))return a.get(t);let i=!0;const n=j(d(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(e=>{if(o?.handleAnsi&&f.test(e))return e;const l=o?.locale?.startsWith("de")?w(e):e,m=o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase();return i?(i=!1,u(m,o)):A(m,o)}),"");return s&&t&&a.set(t,n),n},"camelCase");export{x as default};
1
+ var p=Object.defineProperty;var c=(r,o)=>p(r,"name",{value:o,configurable:!0});import{R as f}from"../packem_shared/constants-DmzZF6_u.js";import h from"../packem_shared/LRUCache-Dpk7Vnfr.js";import u from"./lower-first.js";import{splitByCase as d}from"./split-by-case.js";import A from"./upper-first.js";import{a as E}from"../packem_shared/generate-cache-key-DPByFaMH.js";import j from"../packem_shared/joinSegments-D27SxoCV.js";import{l as w}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var y=Object.defineProperty,v=c((r,o)=>y(r,"name",{value:o,configurable:!0}),"o");const C=new h(1e3),x=v((r,o)=>{if(typeof r!="string"||!r)return"";const s=o?.cache??!1,a=o?.cacheStore??C;let t;if(s&&(t=E(r,o)),s&&t&&a.has(t))return a.get(t);let i=!0;const n=j(d(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(e=>{if(o?.handleAnsi&&f.test(e))return e;const l=o?.locale?.startsWith("de")?w(e):e,m=o?.locale?l.toLocaleLowerCase(o.locale):l.toLowerCase();return i?(i=!1,u(m,o)):A(m,o)}),"");return s&&t&&a.set(t,n),n},"camelCase");export{x as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, b as CapitalCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, b as CapitalCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to Capital Case.
6
6
  * @example
@@ -1 +1 @@
1
- var c=Object.defineProperty;var l=(r,o)=>c(r,"name",{value:o,configurable:!0});import{R as p}from"../packem_shared/constants-DmzZF6_u.js";import f from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as h}from"./split-by-case.js";import u from"./upper-first.js";import{a as A}from"../packem_shared/generate-cache-key-DPByFaMH.js";import d from"../packem_shared/joinSegments-D27SxoCV.js";import{l as y}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var j=Object.defineProperty,w=l((r,o)=>j(r,"name",{value:o,configurable:!0}),"l");const E=new f(1e3),R=w((r,o)=>{if(typeof r!="string")return"";const e=o?.cache??!1,s=o?.cacheStore??E;let a;if(e&&(a=A(r,o)),e&&a&&s.has(a))return s.get(a);const m=h(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 u(o?.locale?n.toLocaleLowerCase(o.locale):n.toLocaleLowerCase(),o)}),i=d(m," ");return e&&a&&s.set(a,i),i},"capitalCase");export{R 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-DmzZF6_u.js";import f from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as h}from"./split-by-case.js";import u from"./upper-first.js";import{a as A}from"../packem_shared/generate-cache-key-DPByFaMH.js";import d from"../packem_shared/joinSegments-D27SxoCV.js";import{l as y}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var j=Object.defineProperty,w=l((r,o)=>j(r,"name",{value:o,configurable:!0}),"l");const E=new f(1e3),R=w((r,o)=>{if(typeof r!="string")return"";const e=o?.cache??!1,s=o?.cacheStore??E;let a;if(e&&(a=A(r,o)),e&&a&&s.has(a))return s.get(a);const m=h(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 u(o?.locale?n.toLocaleLowerCase(o.locale):n.toLocaleLowerCase(),o)}),i=d(m," ");return e&&a&&s.set(a,i),i},"capitalCase");export{R as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, c as ConstantCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to CONSTANT_CASE.
6
6
  * @example
@@ -1 +1 @@
1
- var t=Object.defineProperty;var a=(e,r)=>t(e,"name",{value:r,configurable:!0});import o from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";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
+ var t=Object.defineProperty;var a=(e,r)=>t(e,"name",{value:r,configurable:!0});import o from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";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,6 +1,6 @@
1
- import { C as CaseOptions, D as DotCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, D as DotCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to dot.case.
6
6
  * @example
@@ -1 +1 @@
1
- var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";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
+ var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";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,6 +1,6 @@
1
- import { C as CaseOptions, F as FlatCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, F as FlatCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to flat case (all lowercase, no separators).
6
6
  * @example
@@ -1 +1 @@
1
- var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";var f=Object.defineProperty,i=r((e,a)=>f(e,"name",{value:a,configurable:!0}),"s");const s=new t(1e3),l=i((e,a)=>n(e,{cacheStore:s,...a,joiner:""}),"flatCase");export{l as default};
1
+ var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";var f=Object.defineProperty,i=r((e,a)=>f(e,"name",{value:a,configurable:!0}),"s");const s=new t(1e3),l=i((e,a)=>n(e,{cacheStore:s,...a,joiner:""}),"flatCase");export{l as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, d as FlipCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, d as FlipCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Options specific to flip case operations.
6
6
  * Note: handleEmoji is not needed as the function preserves emojis by default
@@ -1 +1 @@
1
- var g=Object.defineProperty;var u=(r,e)=>g(r,"name",{value:e,configurable:!0});import{createRequire as h}from"node:module";import{s as j}from"../packem_shared/constants-DmzZF6_u.js";import b from"../packem_shared/LRUCache-Bjo6gsbC.js";import{a as v}from"../packem_shared/generate-cache-key-DPByFaMH.js";const d=h(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=u(r=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,s]=l.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return l.getBuiltinModule(r)}return d(r)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:C}=_("node:util");var y=Object.defineProperty,T=u((r,e)=>y(r,"name",{value:e,configurable:!0}),"f");const L=new b(1e3),E=T((r,e)=>{if(typeof r!="string"||r.length===0)return"";const s=e?.cache??!1,c=e?.cacheStore??L;let n;if(s&&(n=v(r,e)),s&&n&&c.has(n))return c.get(n);let o=r;e?.stripEmoji&&(o=j(o)),e?.stripAnsi&&(o=C(o));let a="",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],a+=f),t+=1;continue}const i=o[t],m=e?.locale?i.toLocaleLowerCase(e.locale):i.toLowerCase();let p;i===m?p=e?.locale?i.toLocaleUpperCase(e.locale):i.toUpperCase():p=m,a+=p,t+=1}return s&&n&&c.set(n,a),a},"flipCase");export{E as flipCase};
1
+ var g=Object.defineProperty;var u=(r,e)=>g(r,"name",{value:e,configurable:!0});import{createRequire as h}from"node:module";import{s as j}from"../packem_shared/constants-DmzZF6_u.js";import b from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{a as v}from"../packem_shared/generate-cache-key-DPByFaMH.js";const d=h(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=u(r=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,s]=l.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return l.getBuiltinModule(r)}return d(r)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:C}=_("node:util");var y=Object.defineProperty,T=u((r,e)=>y(r,"name",{value:e,configurable:!0}),"f");const L=new b(1e3),E=T((r,e)=>{if(typeof r!="string"||r.length===0)return"";const s=e?.cache??!1,c=e?.cacheStore??L;let n;if(s&&(n=v(r,e)),s&&n&&c.has(n))return c.get(n);let o=r;e?.stripEmoji&&(o=j(o)),e?.stripAnsi&&(o=C(o));let a="",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],a+=f),t+=1;continue}const i=o[t],m=e?.locale?i.toLocaleLowerCase(e.locale):i.toLowerCase();let p;i===m?p=e?.locale?i.toLocaleUpperCase(e.locale):i.toUpperCase():p=m,a+=p,t+=1}return s&&n&&c.set(n,a),a},"flipCase");export{E as flipCase};
@@ -1,6 +1,6 @@
1
- import { I as IdentifyCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { I as IdentifyCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Identifies the case style of a string.
6
6
  * @example
@@ -1,4 +1,4 @@
1
- export { type N as NodeLocale } from "../packem_shared/types.d-CEMfJjRV.js";
1
+ export { type N as NodeLocale } from "../packem_shared/types.d-NJ4vcG-A.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,9 +17,9 @@ 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 a as CamelCase, type b as CapitalCase, type C as CaseOptions, type c as ConstantCase, type D as DotCase, type F as FlatCase, type d as FlipCase, type I as IdentifyCase, type K as KebabCase, type L as LocaleOptions, type e as LowerFirst, type N as NoCase, type P as PascalCase, type f as PascalSnakeCase, type g as PathCase, type S as SentenceCase, type h as SnakeCase, type i as SplitByCase, type T as TitleCase, type j as TrainCase, type U as UpperFirst } from "../packem_shared/types.d-BaFAOLxg.js";
20
+ export { type a as CamelCase, type b as CapitalCase, type C as CaseOptions, type c as ConstantCase, type D as DotCase, type F as FlatCase, type d as FlipCase, type I as IdentifyCase, type K as KebabCase, type L as LocaleOptions, type e as LowerFirst, type N as NoCase, type P as PascalCase, type f as PascalSnakeCase, type g as PathCase, type S as SentenceCase, type h as SnakeCase, type i as SplitByCase, type T as TitleCase, type j as TrainCase, type U as UpperFirst } from "../packem_shared/types.d-XxhGlCLZ.js";
21
21
  export { default as upperFirst } from "./upper-first.js";
22
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
22
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
23
23
  /**
24
24
  * Joins segments with a joiner, handling ANSI sequences and emojis correctly.
25
25
  * @param segments Array of segments to join
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, K as KebabCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, K as KebabCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  interface KebabCaseOptions extends CaseOptions {
5
5
  /**
6
6
  * String used to join words together in kebab case format.
@@ -1 +1 @@
1
- var m=Object.defineProperty;var l=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as p}from"../packem_shared/constants-DmzZF6_u.js";import f from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as h}from"./split-by-case.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import A from"../packem_shared/joinSegments-D27SxoCV.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var C=Object.defineProperty,b=l((r,o)=>C(r,"name",{value:o,configurable:!0}),"o");const j=new f(1e3),S=b((r,o)=>{if(typeof r!="string")return"";const s=o?.cache??!1,a=o?.cacheStore??j;let e;if(s&&(e=u(r,o)),s&&e&&a.has(e))return a.get(e);const c=h(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(o?.handleAnsi&&p.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?d(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),n=A(c,o?.joiner??"-");return s&&e&&a.set(e,n),n},"kebabCase");export{S as kebabCase};
1
+ var m=Object.defineProperty;var l=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as p}from"../packem_shared/constants-DmzZF6_u.js";import f from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as h}from"./split-by-case.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import A from"../packem_shared/joinSegments-D27SxoCV.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var C=Object.defineProperty,b=l((r,o)=>C(r,"name",{value:o,configurable:!0}),"o");const j=new f(1e3),S=b((r,o)=>{if(typeof r!="string")return"";const s=o?.cache??!1,a=o?.cacheStore??j;let e;if(s&&(e=u(r,o)),s&&e&&a.has(e))return a.get(e);const c=h(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(o?.handleAnsi&&p.test(t))return t;if(o?.toUpperCase)return o.locale?t.toLocaleUpperCase(o.locale):t.toUpperCase();const i=o?.locale?.startsWith("de")?d(t):t;return o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase()}),n=A(c,o?.joiner??"-");return s&&e&&a.set(e,n),n},"kebabCase");export{S as kebabCase};
@@ -1,6 +1,6 @@
1
- import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { L as LocaleOptions, e as LowerFirst } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts first character to lower case.
6
6
  * @param value The string to convert.
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, N as NoCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, N as NoCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to no case (space separated words).
6
6
  * @example
@@ -1 +1 @@
1
- var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";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:" "}),"noCase");export{p as default};
1
+ var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";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:" "}),"noCase");export{p as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, P as PascalCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, P as PascalCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to PascalCase.
6
6
  * @param value The string to convert.
@@ -1 +1 @@
1
- var m=Object.defineProperty;var l=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as c}from"../packem_shared/constants-DmzZF6_u.js";import p from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as f}from"./split-by-case.js";import h from"./upper-first.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import A from"../packem_shared/joinSegments-D27SxoCV.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var j=Object.defineProperty,w=l((r,o)=>j(r,"name",{value:o,configurable:!0}),"i");const y=new p(1e3),z=w((r,o)=>{if(typeof r!="string"||!r)return"";const e=o?.cache??!1,s=o?.cacheStore??y;let a;if(e&&(a=u(r,o)),e&&a&&s.has(a))return s.get(a);const n=A(f(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(o?.handleAnsi&&c.test(t))return t;const i=o?.locale?.startsWith("de")?d(t):t;return h(o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase(),{locale:o?.locale})}),"");return e&&a&&s.set(a,n),n},"pascalCase");export{z as default};
1
+ var m=Object.defineProperty;var l=(r,o)=>m(r,"name",{value:o,configurable:!0});import{R as c}from"../packem_shared/constants-DmzZF6_u.js";import p from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as f}from"./split-by-case.js";import h from"./upper-first.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import A from"../packem_shared/joinSegments-D27SxoCV.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var j=Object.defineProperty,w=l((r,o)=>j(r,"name",{value:o,configurable:!0}),"i");const y=new p(1e3),z=w((r,o)=>{if(typeof r!="string"||!r)return"";const e=o?.cache??!1,s=o?.cacheStore??y;let a;if(e&&(a=u(r,o)),e&&a&&s.has(a))return s.get(a);const n=A(f(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(o?.handleAnsi&&c.test(t))return t;const i=o?.locale?.startsWith("de")?d(t):t;return h(o?.locale?i.toLocaleLowerCase(o.locale):i.toLowerCase(),{locale:o?.locale})}),"");return e&&a&&s.set(a,n),n},"pascalCase");export{z as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, f as PascalSnakeCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to Pascal_Snake_Case.
6
6
  * @example
@@ -1 +1 @@
1
- var f=Object.defineProperty;var n=(r,e)=>f(r,"name",{value:e,configurable:!0});import l from"../packem_shared/LRUCache-Bjo6gsbC.js";import m from"./no-case.js";import p from"./upper-first.js";import{a as s}from"../packem_shared/generate-cache-key-DPByFaMH.js";var u=Object.defineProperty,h=n((r,e)=>u(r,"name",{value:e,configurable:!0}),"n");const g=new l(1e3),S=h((r,e)=>{if(typeof r!="string")return"";const a=e?.cache??!1,o=e?.cacheStore??g;let t;if(a&&(t=s(r,e)),a&&t&&o.has(t))return o.get(t);const c=m(r,{...e,cache:!1}).split(" ").map(i=>p(i,{locale:e?.locale})).join("_");return a&&t&&o.set(t,c),c},"pascalSnakeCase");export{S as default};
1
+ var f=Object.defineProperty;var n=(r,e)=>f(r,"name",{value:e,configurable:!0});import l from"../packem_shared/LRUCache-Dpk7Vnfr.js";import m from"./no-case.js";import p from"./upper-first.js";import{a as s}from"../packem_shared/generate-cache-key-DPByFaMH.js";var u=Object.defineProperty,h=n((r,e)=>u(r,"name",{value:e,configurable:!0}),"n");const g=new l(1e3),S=h((r,e)=>{if(typeof r!="string")return"";const a=e?.cache??!1,o=e?.cacheStore??g;let t;if(a&&(t=s(r,e)),a&&t&&o.has(t))return o.get(t);const c=m(r,{...e,cache:!1}).split(" ").map(i=>p(i,{locale:e?.locale})).join("_");return a&&t&&o.set(t,c),c},"pascalSnakeCase");export{S as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, g as PathCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, g as PathCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to path/case.
6
6
  * @example
@@ -1 +1 @@
1
- var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";var i=Object.defineProperty,s=r((e,a)=>i(e,"name",{value:a,configurable:!0}),"a");const c=new t(1e3),b=s((e,a)=>n(e,{cacheStore:c,...a,joiner:"/"}),"pathCase");export{b as default};
1
+ var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";var i=Object.defineProperty,s=r((e,a)=>i(e,"name",{value:a,configurable:!0}),"a");const c=new t(1e3),b=s((e,a)=>n(e,{cacheStore:c,...a,joiner:"/"}),"pathCase");export{b as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, S as SentenceCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, S as SentenceCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to Sentence case.
6
6
  * @example
@@ -1 +1 @@
1
- var p=Object.defineProperty;var c=(o,r)=>p(o,"name",{value:r,configurable:!0});import{R as f}from"../packem_shared/constants-DmzZF6_u.js";import h from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as u}from"./split-by-case.js";import A from"./upper-first.js";import{a as d}from"../packem_shared/generate-cache-key-DPByFaMH.js";import y from"../packem_shared/joinSegments-D27SxoCV.js";import{l as j}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var w=Object.defineProperty,E=c((o,r)=>w(o,"name",{value:r,configurable:!0}),"o");const v=new h(1e3),_=E((o,r)=>{if(typeof o!="string")return"";const a=r?.cache??!1,s=r?.cacheStore??v;let t;if(a&&(t=d(o,r)),a&&t&&s.has(t))return s.get(t);let i=!0;const n=y(u(o,{handleAnsi:r?.handleAnsi,handleEmoji:r?.handleEmoji,knownAcronyms:r?.knownAcronyms,locale:r?.locale,normalize:r?.normalize,separators:void 0,stripAnsi:r?.stripAnsi,stripEmoji:r?.stripEmoji}).map(e=>{if(r?.handleAnsi&&f.test(e))return e;const l=r?.locale?.startsWith("de")?j(e):e,m=r?.locale?l.toLocaleLowerCase(r.locale):l.toLowerCase();return i?(i=!1,A(m,r)):m})," ");return a&&t&&s.set(t,n),n},"sentenceCase");export{_ as default};
1
+ var p=Object.defineProperty;var c=(o,r)=>p(o,"name",{value:r,configurable:!0});import{R as f}from"../packem_shared/constants-DmzZF6_u.js";import h from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as u}from"./split-by-case.js";import A from"./upper-first.js";import{a as d}from"../packem_shared/generate-cache-key-DPByFaMH.js";import y from"../packem_shared/joinSegments-D27SxoCV.js";import{l as j}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var w=Object.defineProperty,E=c((o,r)=>w(o,"name",{value:r,configurable:!0}),"o");const v=new h(1e3),_=E((o,r)=>{if(typeof o!="string")return"";const a=r?.cache??!1,s=r?.cacheStore??v;let t;if(a&&(t=d(o,r)),a&&t&&s.has(t))return s.get(t);let i=!0;const n=y(u(o,{handleAnsi:r?.handleAnsi,handleEmoji:r?.handleEmoji,knownAcronyms:r?.knownAcronyms,locale:r?.locale,normalize:r?.normalize,separators:void 0,stripAnsi:r?.stripAnsi,stripEmoji:r?.stripEmoji}).map(e=>{if(r?.handleAnsi&&f.test(e))return e;const l=r?.locale?.startsWith("de")?j(e):e,m=r?.locale?l.toLocaleLowerCase(r.locale):l.toLowerCase();return i?(i=!1,A(m,r)):m})," ");return a&&t&&s.set(t,n),n},"sentenceCase");export{_ as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, h as SnakeCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, h as SnakeCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to snake_case.
6
6
  * @example
@@ -1 +1 @@
1
- var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Bjo6gsbC.js";import{kebabCase as n}from"./kebab-case.js";var s=Object.defineProperty,i=a((e,r)=>s(e,"name",{value:r,configurable:!0}),"s");const c=new t(1e3),p=i((e,r)=>n(e,{cacheStore:c,...r,joiner:"_"}),"snakeCase");export{p as default};
1
+ var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});import t from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{kebabCase as n}from"./kebab-case.js";var s=Object.defineProperty,i=a((e,r)=>s(e,"name",{value:r,configurable:!0}),"s");const c=new t(1e3),p=i((e,r)=>n(e,{cacheStore:c,...r,joiner:"_"}),"snakeCase");export{p as default};
@@ -1,6 +1,6 @@
1
- import { L as LocaleOptions, i as SplitByCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { L as LocaleOptions, i as SplitByCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /** Options for the `splitByCase` function. */
5
5
  interface SplitOptions extends LocaleOptions {
6
6
  /** Whether to handle ANSI escape sequences. (default: false) */
@@ -1 +1 @@
1
- var $=Object.defineProperty;var W=(e,s)=>$(e,"name",{value:s,configurable:!0});import{createRequire as V}from"node:module";import{i as y,s as ee,l as te,R as x,m as b,n as C,o as T,p as S,q as se,r as O,t as ne,u as M,v as P,w as G,x as re,y as ae,z as le,A as oe,B as ie,C as ce,D as he,E as pe,F as ue,G as fe,H as ge,I as Ae,J as Ee,K as Re,L as _e,M as de,N as K}from"../packem_shared/constants-DmzZF6_u.js";import Le from"../packem_shared/LRUCache-Bjo6gsbC.js";const Z=V(import.meta.url),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=W(e=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[s,h]=j.versions.node.split(".").map(Number);if(s>22||s===22&&h>=3||s===20&&h>=16)return j.getBuiltinModule(e)}return Z(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:X}=Q("node:util");var Ce=Object.defineProperty,me=W((e,s)=>Ce(e,"name",{value:s,configurable:!0}),"g");const N=new Le(1e3),Ue=/[.*+?^${}()|[\]\\]/g,ke=me(e=>{const s=e.join("");if(N.has(s))return N.get(s);const h=e.map(R=>R.replaceAll(Ue,String.raw`\$&`)).join("|"),g=new RegExp(h,"g");return N.set(s,g),g},"getSeparatorsRegex");var Ie=Object.defineProperty,be=W((e,s)=>Ie(e,"name",{value:s,configurable:!0}),"t");const We=be(e=>{const s=[];let h=0,g;for(y.lastIndex=0;(g=y.exec(e))!==null;)g.index>h&&s.push(e.slice(h,g.index)),s.push(g[0]),h=y.lastIndex;return h<e.length&&s.push(e.slice(h)),s.filter(Boolean)},"splitByEmoji");var je=Object.defineProperty,A=W((e,s)=>je(e,"name",{value:s,configurable:!0}),"u");const ye=/[ČŠŽĐ]/i,z=new Uint8Array(128),D=new Uint8Array(128),J=new Uint8Array(128);for(let e=0;e<128;e++)z[e]=e>=65&&e<=90?1:0,D[e]=e>=97&&e<=122?1:0,J[e]=e>=48&&e<=57?1:0;const w=A(e=>z[e],"isUpper"),H=A(e=>D[e],"isLower"),v=A(e=>J[e],"isDigit"),I=A((e,s,h,g,R)=>{if(e.length===0)return[];let u=!1;const L=Object.values(s);for(const a of L)if(a(e[0])){u=!0;break}if(!u&&!h)return[e];const f=[...e],_=[];let n=f[0],l="other";const c=Object.entries(s);for(const a of c){const[r,i]=a;if(i(f[0])){l=r;break}}let t=h&&g?f[0]===f[0].toLocaleUpperCase(g):!1;for(let a=1;a<f.length;a++){const r=f[a];let i="other";for(const E of c){const[d,m]=E;if(m(r)){i=d;break}}const p=h&&g?r===r.toLocaleUpperCase(g):!1;let o=!1;R?o=R(l,i,t,p,r,a,f):(l!==i&&l!=="other"&&i!=="other"&&(o=!0),h&&i!=="other"&&!t&&p&&(o=!0)),o?(_.push(n),n=r):n+=r,l=i,h&&(t=p)}return n&&n.length>0&&_.push(n),_.length>0?_:[e]},"handleScriptTransitions"),xe=A((e,s,h,g)=>{if(h.size===0)return s;for(const R of h)if(e.startsWith(R,s))return g.push(R),s+R.length;return s},"detectAndProcessAcronym"),q=A((e,s=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let h=0;const g=[],R=e.length;for(let u=1;u<R;u++){const L=xe(e,h,s,g);if(L!==h){h=L,u=h-1;continue}const f=e.codePointAt(u-1),_=e.codePointAt(u),n=f&&f<128&&w(f),l=_&&_<128&&w(_),c=f&&f<128&&H(f),t=f&&f<128&&v(f),a=_&&_<128&&v(_);if(c&&l){g.push(e.slice(h,u)),h=u;continue}if(t&&!a||!t&&a){g.push(e.slice(h,u)),h=u;continue}if(a&&!t){let r=!1,i=!1;if(u+1<R){const p=e.codePointAt(u+1);r=p&&p<128&&w(p),i=p&&p<128&&v(p)}if(!i&&r){g.push(e.slice(h,u),e.slice(u,u+1)),h=u+1;continue}}if(u+1<R){const r=e.codePointAt(u+1),i=r&&r<128&&H(r);if(n&&l&&i){const p=e.slice(h,u+1);s.has(p)||(g.push(e.slice(h,u)),h=u)}}}return h<R&&g.push(e.slice(h)),g.filter(u=>u!=="")},"splitCamelCaseFast"),F=A((e,s,h)=>{if(e.length===0)return[];const g=e===e.toLocaleUpperCase(s);if(s.startsWith("de")){if(!g&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(s))return[e];const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s),r=a,i=a?0:-1;for(let p=1;p<l;p++){const o=n[p],E=o===o.toLocaleUpperCase(s);if(E===a)t+=o;else if(E)t&&t.length>0&&(c.push(t),t=o),r=!0,i=p;else{if(r&&p-i>1){const d=n[p-1],m=t.slice(0,-1);m&&m.length>0&&c.push(m),t=d+o}else t+=o;r=!1,i=-1}a=E}return t&&t.length>0&&c.push(t),c}if(s.startsWith("uk")||s.startsWith("ru")||s.startsWith("bg")||s.startsWith("sr")||s.startsWith("mk")||s.startsWith("be")){if(!b.test(e)&&!C.test(e))return[e];const n=[...e],l=n.length,c=[];let t=n[0];const a=n[0];let r;b.test(a)?r=1:C.test(a)?r=2:r=0;let i=a===a.toLocaleUpperCase(s);for(let o=1;o<l;o++){const E=n[o];let d;b.test(E)?d=1:C.test(E)?d=2:d=0;const m=E===E.toLocaleUpperCase(s);r!==d&&(r===1||r===2)&&(d===1||d===2)||d===r&&!i&&m?(c.push(t),t=E):t+=E,r=d,i=m}t&&t.length>0&&c.push(t);const p=[];for(let o=0;o<c.length;o++)o<c.length-1&&c[o].length===1&&C.test(c[o])&&b.test(c[o+1][0])?(p.push(c[o]+c[o+1]),o+=1):p.push(c[o]);return p}if(s.startsWith("el")){if(!T.test(e)&&!C.test(e))return[e];const n=[];S.lastIndex=0;let l;for(;(l=S.exec(e))!==null;)n.push(l[0]);n.length===0&&n.push(e);const c=[];if(n.length===1){const t=n[0];if(!t||!T.test(t[0])||t.length===1)return[t??e]}for(const t of n){if(!t)continue;if(!T.test(t[0])||t.length===1){c.push(t);continue}const a=t.length;let r=t[0],i=t[0]===t[0].toLocaleUpperCase(s);for(let p=1;p<a;p++){const o=t[p],E=o===o.toLocaleUpperCase(s);!i&&E?(c.push(r),r=o):r+=o,i=E}r&&c.push(r)}return c}if(s.startsWith("ja")||s.startsWith("ko")){const n=s.startsWith("ja"),l=n?{hiragana:A(t=>ne.test(t),"hiragana"),kanji:A(t=>O.test(t),"kanji"),katakana:A(t=>se.test(t),"katakana"),latin:A(t=>C.test(t),"latin")}:{hangul:A(t=>M.test(t),"hangul"),latin:A(t=>C.test(t),"latin")},c=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(n){const t=I(e,l,!1,s,(r,i)=>r==="hiragana"&&i==="katakana"||r==="katakana"&&i==="hiragana"||r==="hiragana"&&i==="latin"||r==="katakana"&&i==="latin"||r==="kanji"&&i==="latin"||r==="latin"&&(i==="hiragana"||i==="katakana"||i==="kanji")),a=[];for(const r of t){const i=r;i.length===1&&c.has(i)&&a.length>0?a[a.length-1]=a.at(-1)+i:a.push(i)}return a.length>0?a:[e]}return I(e,l,!1,s,(t,a)=>t==="hangul"&&a==="latin"||t==="latin"&&a==="hangul")}if(s.startsWith("sl")){const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s);for(let r=1;r<l;r++){const i=n[r],p=i===i.toLocaleUpperCase(s),o=ye.test(i),E=r<l-1&&n[r+1]===n[r+1].toLocaleUpperCase(s);!a&&p||o&&E?(c.push(t),t=i,o&&E&&(c.push(t),t="")):t+=i,a=p}return t&&t.length>0&&c.push(t),c}if(s.startsWith("zh"))return I(e,{han:A(n=>O.test(n),"han"),latin:A(n=>C.test(n),"latin")},!1,s);if(["ar","fa","he","ur"].includes(s.split("-")[0])){const n=A(l=>P.test(l)||G.test(l),"isRtlChar");return I(e,{latin:A(l=>C.test(l),"latin"),rtl:A(l=>n(l),"rtl")},!1,s)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(s.split("-")[0])){const n=A(l=>re.test(l)||ae.test(l)||le.test(l)||oe.test(l)||ie.test(l)||ce.test(l)||he.test(l)||pe.test(l)||ue.test(l)||fe.test(l)||ge.test(l)||Ae.test(l)||Ee.test(l)||Re.test(l)||_e.test(l)||de.test(l),"isIndicChar");return I(e,{indic:A(l=>n(l),"indic"),latin:A(l=>C.test(l),"latin")},!1,s)}if(["be","bg","ru","sr","uk"].includes(s))return I(e,{cyrillic:A(n=>b.test(n),"cyrillic"),latin:A(n=>C.test(n),"latin")},!0,s);if(["ar","fa","he"].includes(s))return I(e,{latin:A(n=>C.test(n),"latin"),rtl:A(n=>P.test(n)||G.test(n),"rtl")},!1,s);if(s.startsWith("ko"))return I(e,{hangul:A(n=>M.test(n),"hangul"),latin:A(n=>C.test(n),"latin")},!1,s);if(s.startsWith("uz")){if(!b.test(e)&&!C.test(e))return[e];const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s);for(let r=1;r<l;r++){const i=n[r],p=i===i.toLocaleUpperCase(s);if(K.test(i)||K.test(n[r-1])){t+=i;continue}!a&&p?(c.push(t),t=i):t+=i,a=p}return t&&t.length>0&&c.push(t),c}const R=[...e],u=R.length,L=[];let f=R[0],_=R[0]===R[0].toLocaleUpperCase(s);for(const n of h)if(e.startsWith(n)){L.push(n),f=R[n.length],_=f===f.toLocaleUpperCase(s);break}for(let n=1;n<u;n++){const l=R[n],c=l===l.toLocaleUpperCase(s);let t=0;for(const a of h)if(e.startsWith(a,n)){L.push(f,a),t=a.length,f="";const r=a.at(-1);r&&(_=r===r.toLocaleUpperCase(s));break}if(t>0){n+=t-1;continue}!_&&c?(L.push(f),f=l):f+=l,_=c}return f&&L.push(f),L},"splitCamelCaseLocale"),Te=A((e,s,h)=>{const g=[],R=x.test(e)?e.split(x).filter(Boolean):[e];for(const u of R){const L=u;if(x.test(L))g.push(L);else{const f=y.test(L)?We(L).filter(Boolean):[L];for(const _ of f)if(y.test(_))g.push(_);else if(s){const n=s.toLowerCase().split("-")[0];g.push(...F(_,n,h))}else g.push(...q(_,h))}}return g},"processTextWithAnsiEmoji"),Se=A((e,s={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:h=!1,handleEmoji:g=!1,knownAcronyms:R=[],locale:u,normalize:L=!1,separators:f,stripAnsi:_=!1,stripEmoji:n=!1}=s,l=new Set([...R].toSorted((o,E)=>E.length-o.length));let c=e;_&&(c=X(c)),n&&(c=ee(c));let t;Array.isArray(f)?t=ke(f):f instanceof RegExp?t=f:t=te;const a=[];let r=c;const i=t.flags.includes("g")?t:new RegExp(t.source,`${t.flags}g`);for(;r.length>0;){const o=i.exec(r);if(!o){r===".."?a.push(".."):r==="."?a.push("."):r.length>0&&a.push(r);break}const E=o.index,d=o[0],m=d.length,B=r.slice(0,E),Y=r.slice(E+m);if(d.startsWith("../"))a.push(".."),r=r.slice(E+3);else if(d.startsWith("./"))a.push("."),r=r.slice(E+2);else if(E===0&&d==="..")a.push(".."),r=r.slice(2);else if(E===0&&d===".")a.push("."),r=r.slice(1);else{B.length>0&&a.push(B);let U=0;for(;(U=d.indexOf("../",U))!==-1;)a.push(".."),U+=3;for(U=0;(U=d.indexOf("./",U))!==-1;)(U===0||d[U-1]!==".")&&a.push("."),U+=2;let k=Y;for(;k.startsWith("../");)a.push(".."),k=k.slice(3);for(;k.startsWith("./");)a.push("."),k=k.slice(2);if(k===".."){a.push("..");break}else if(k==="."){a.push(".");break}else r=k}i.lastIndex=0}if(a.length===0){const o=c.split(t).filter(Boolean);a.push(...o)}let p=[];for(const o of a)h||g?p.push(...Te(o,u,l)):u?p.push(...F(o,u,l)):p.push(...q(o,l));return L&&(p=p.map(o=>l.has(o)?o:u&&o===o.toLocaleUpperCase(u)?o[0]+o.slice(1).toLocaleLowerCase(u):o.toUpperCase()===o&&!l.has(o)?o.slice(0,1)+o.slice(1).toLowerCase():o)),p},"splitByCase");export{Se as splitByCase};
1
+ var $=Object.defineProperty;var j=(e,s)=>$(e,"name",{value:s,configurable:!0});import{createRequire as V}from"node:module";import{i as b,s as ee,l as te,R as y,m as W,n as C,o as T,p as S,q as se,r as O,t as ne,u as M,v as P,w as G,x as re,y as ae,z as le,A as oe,B as ie,C as ce,D as he,E as pe,F as ue,G as fe,H as ge,I as Ae,J as Ee,K as Re,L as de,M as _e,N as K}from"../packem_shared/constants-DmzZF6_u.js";import Le from"../packem_shared/LRUCache-Dpk7Vnfr.js";const Z=V(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=j(e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[s,h]=x.versions.node.split(".").map(Number);if(s>22||s===22&&h>=3||s===20&&h>=16)return x.getBuiltinModule(e)}return Z(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:X}=Q("node:util");var Ce=Object.defineProperty,me=j((e,s)=>Ce(e,"name",{value:s,configurable:!0}),"a");const N=new Le(1e3),Ie=/[.*+?^${}()|[\]\\]/g,ke=me(e=>{const s=e.join("");if(N.has(s)){const E=N.get(s);return E.lastIndex=0,E}const h=e.map(E=>E.replaceAll(Ie,String.raw`\$&`)).join("|"),g=new RegExp(h,"g");return N.set(s,g),g},"getSeparatorsRegex");var Ue=Object.defineProperty,be=j((e,s)=>Ue(e,"name",{value:s,configurable:!0}),"t");const We=be(e=>{const s=[];let h=0,g;for(b.lastIndex=0;(g=b.exec(e))!==null;)g.index>h&&s.push(e.slice(h,g.index)),s.push(g[0]),h=b.lastIndex;return h<e.length&&s.push(e.slice(h)),s.filter(Boolean)},"splitByEmoji");var je=Object.defineProperty,A=j((e,s)=>je(e,"name",{value:s,configurable:!0}),"u");const xe=/[ČŠŽĐ]/i,z=new Uint8Array(128),D=new Uint8Array(128),J=new Uint8Array(128);for(let e=0;e<128;e++)z[e]=e>=65&&e<=90?1:0,D[e]=e>=97&&e<=122?1:0,J[e]=e>=48&&e<=57?1:0;const w=A(e=>z[e],"isUpper"),H=A(e=>D[e],"isLower"),v=A(e=>J[e],"isDigit"),U=A((e,s,h,g,E)=>{if(e.length===0)return[];let u=!1;const L=Object.values(s);for(const a of L)if(a(e[0])){u=!0;break}if(!u&&!h)return[e];const f=[...e],d=[];let n=f[0],l="other";const c=Object.entries(s);for(const a of c){const[r,i]=a;if(i(f[0])){l=r;break}}let t=h&&g?f[0]===f[0].toLocaleUpperCase(g):!1;for(let a=1;a<f.length;a++){const r=f[a];let i="other";for(const R of c){const[_,m]=R;if(m(r)){i=_;break}}const p=h&&g?r===r.toLocaleUpperCase(g):!1;let o=!1;E?o=E(l,i,t,p,r,a,f):(l!==i&&l!=="other"&&i!=="other"&&(o=!0),h&&i!=="other"&&!t&&p&&(o=!0)),o?(d.push(n),n=r):n+=r,l=i,h&&(t=p)}return n&&n.length>0&&d.push(n),d.length>0?d:[e]},"handleScriptTransitions"),ye=A((e,s,h,g)=>{if(h.size===0)return s;for(const E of h)if(e.startsWith(E,s))return g.push(E),s+E.length;return s},"detectAndProcessAcronym"),q=A((e,s=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let h=0;const g=[],E=e.length;for(let u=1;u<E;u++){const L=ye(e,h,s,g);if(L!==h){h=L,u=h-1;continue}const f=e.codePointAt(u-1),d=e.codePointAt(u),n=f&&f<128&&w(f),l=d&&d<128&&w(d),c=f&&f<128&&H(f),t=f&&f<128&&v(f),a=d&&d<128&&v(d);if(c&&l){g.push(e.slice(h,u)),h=u;continue}if(t&&!a||!t&&a){g.push(e.slice(h,u)),h=u;continue}if(a&&!t){let r=!1,i=!1;if(u+1<E){const p=e.codePointAt(u+1);r=p&&p<128&&w(p),i=p&&p<128&&v(p)}if(!i&&r){g.push(e.slice(h,u),e.slice(u,u+1)),h=u+1;continue}}if(u+1<E){const r=e.codePointAt(u+1),i=r&&r<128&&H(r);if(n&&l&&i){const p=e.slice(h,u+1);s.has(p)||(g.push(e.slice(h,u)),h=u)}}}return h<E&&g.push(e.slice(h)),g.filter(u=>u!=="")},"splitCamelCaseFast"),F=A((e,s,h)=>{if(e.length===0)return[];const g=e===e.toLocaleUpperCase(s);if(s.startsWith("de")){if(!g&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(s))return[e];const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s),r=a,i=a?0:-1;for(let p=1;p<l;p++){const o=n[p],R=o===o.toLocaleUpperCase(s);if(R===a)t+=o;else if(R)t&&t.length>0&&(c.push(t),t=o),r=!0,i=p;else{if(r&&p-i>1){const _=n[p-1],m=t.slice(0,-1);m&&m.length>0&&c.push(m),t=_+o}else t+=o;r=!1,i=-1}a=R}return t&&t.length>0&&c.push(t),c}if(s.startsWith("uk")||s.startsWith("ru")||s.startsWith("bg")||s.startsWith("sr")||s.startsWith("mk")||s.startsWith("be")){if(!W.test(e)&&!C.test(e))return[e];const n=[...e],l=n.length,c=[];let t=n[0];const a=n[0];let r;W.test(a)?r=1:C.test(a)?r=2:r=0;let i=a===a.toLocaleUpperCase(s);for(let o=1;o<l;o++){const R=n[o];let _;W.test(R)?_=1:C.test(R)?_=2:_=0;const m=R===R.toLocaleUpperCase(s);r!==_&&(r===1||r===2)&&(_===1||_===2)||_===r&&!i&&m?(c.push(t),t=R):t+=R,r=_,i=m}t&&t.length>0&&c.push(t);const p=[];for(let o=0;o<c.length;o++)o<c.length-1&&c[o].length===1&&C.test(c[o])&&W.test(c[o+1][0])?(p.push(c[o]+c[o+1]),o+=1):p.push(c[o]);return p}if(s.startsWith("el")){if(!T.test(e)&&!C.test(e))return[e];const n=[];S.lastIndex=0;let l;for(;(l=S.exec(e))!==null;)n.push(l[0]);n.length===0&&n.push(e);const c=[];if(n.length===1){const t=n[0];if(!t||!T.test(t[0])||t.length===1)return[t??e]}for(const t of n){if(!t)continue;if(!T.test(t[0])||t.length===1){c.push(t);continue}const a=t.length;let r=t[0],i=t[0]===t[0].toLocaleUpperCase(s);for(let p=1;p<a;p++){const o=t[p],R=o===o.toLocaleUpperCase(s);!i&&R?(c.push(r),r=o):r+=o,i=R}r&&c.push(r)}return c}if(s.startsWith("ja")||s.startsWith("ko")){const n=s.startsWith("ja"),l=n?{hiragana:A(t=>ne.test(t),"hiragana"),kanji:A(t=>O.test(t),"kanji"),katakana:A(t=>se.test(t),"katakana"),latin:A(t=>C.test(t),"latin")}:{hangul:A(t=>M.test(t),"hangul"),latin:A(t=>C.test(t),"latin")},c=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(n){const t=U(e,l,!1,s,(r,i)=>r==="hiragana"&&i==="katakana"||r==="katakana"&&i==="hiragana"||r==="hiragana"&&i==="latin"||r==="katakana"&&i==="latin"||r==="kanji"&&i==="latin"||r==="latin"&&(i==="hiragana"||i==="katakana"||i==="kanji")),a=[];for(const r of t){const i=r;i.length===1&&c.has(i)&&a.length>0?a[a.length-1]=a.at(-1)+i:a.push(i)}return a.length>0?a:[e]}return U(e,l,!1,s,(t,a)=>t==="hangul"&&a==="latin"||t==="latin"&&a==="hangul")}if(s.startsWith("sl")){const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s);for(let r=1;r<l;r++){const i=n[r],p=i===i.toLocaleUpperCase(s),o=xe.test(i),R=r<l-1&&n[r+1]===n[r+1].toLocaleUpperCase(s);!a&&p||o&&R?(c.push(t),t=i,o&&R&&(c.push(t),t="")):t+=i,a=p}return t&&t.length>0&&c.push(t),c}if(s.startsWith("zh"))return U(e,{han:A(n=>O.test(n),"han"),latin:A(n=>C.test(n),"latin")},!1,s);if(["ar","fa","he","ur"].includes(s.split("-")[0])){const n=A(l=>P.test(l)||G.test(l),"isRtlChar");return U(e,{latin:A(l=>C.test(l),"latin"),rtl:A(l=>n(l),"rtl")},!1,s)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(s.split("-")[0])){const n=A(l=>re.test(l)||ae.test(l)||le.test(l)||oe.test(l)||ie.test(l)||ce.test(l)||he.test(l)||pe.test(l)||ue.test(l)||fe.test(l)||ge.test(l)||Ae.test(l)||Ee.test(l)||Re.test(l)||de.test(l)||_e.test(l),"isIndicChar");return U(e,{indic:A(l=>n(l),"indic"),latin:A(l=>C.test(l),"latin")},!1,s)}if(["be","bg","ru","sr","uk"].includes(s))return U(e,{cyrillic:A(n=>W.test(n),"cyrillic"),latin:A(n=>C.test(n),"latin")},!0,s);if(["ar","fa","he"].includes(s))return U(e,{latin:A(n=>C.test(n),"latin"),rtl:A(n=>P.test(n)||G.test(n),"rtl")},!1,s);if(s.startsWith("ko"))return U(e,{hangul:A(n=>M.test(n),"hangul"),latin:A(n=>C.test(n),"latin")},!1,s);if(s.startsWith("uz")){if(!W.test(e)&&!C.test(e))return[e];const n=[...e],l=n.length,c=[];let t=n[0],a=n[0]===n[0].toLocaleUpperCase(s);for(let r=1;r<l;r++){const i=n[r],p=i===i.toLocaleUpperCase(s);if(K.test(i)||K.test(n[r-1])){t+=i;continue}!a&&p?(c.push(t),t=i):t+=i,a=p}return t&&t.length>0&&c.push(t),c}const E=[...e],u=E.length,L=[];let f=E[0],d=E[0]===E[0].toLocaleUpperCase(s);for(const n of h)if(e.startsWith(n)){L.push(n),f=E[n.length],d=f===f.toLocaleUpperCase(s);break}for(let n=1;n<u;n++){const l=E[n],c=l===l.toLocaleUpperCase(s);let t=0;for(const a of h)if(e.startsWith(a,n)){L.push(f,a),t=a.length,f="";const r=a.at(-1);r&&(d=r===r.toLocaleUpperCase(s));break}if(t>0){n+=t-1;continue}!d&&c?(L.push(f),f=l):f+=l,d=c}return f&&L.push(f),L},"splitCamelCaseLocale"),Te=A((e,s,h)=>{const g=[],E=y.test(e)?e.split(y).filter(Boolean):[e];for(const u of E){const L=u;if(y.test(L))g.push(L);else{b.lastIndex=0;const f=b.test(L)?We(L).filter(Boolean):[L];for(const d of f)if(b.lastIndex=0,b.test(d))g.push(d);else if(s){const n=s.toLowerCase().split("-")[0];g.push(...F(d,n,h))}else g.push(...q(d,h))}}return g},"processTextWithAnsiEmoji"),Se=A((e,s={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:h=!1,handleEmoji:g=!1,knownAcronyms:E=[],locale:u,normalize:L=!1,separators:f,stripAnsi:d=!1,stripEmoji:n=!1}=s,l=new Set([...E].toSorted((o,R)=>R.length-o.length));let c=e;d&&(c=X(c)),n&&(c=ee(c));let t;Array.isArray(f)?t=ke(f):f instanceof RegExp?t=f:t=te;const a=[];let r=c;const i=t.flags.includes("g")?t:new RegExp(t.source,`${t.flags}g`);for(;r.length>0;){const o=i.exec(r);if(!o){r===".."?a.push(".."):r==="."?a.push("."):r.length>0&&a.push(r);break}const R=o.index,_=o[0],m=_.length,B=r.slice(0,R),Y=r.slice(R+m);if(_.startsWith("../"))a.push(".."),r=r.slice(R+3);else if(_.startsWith("./"))a.push("."),r=r.slice(R+2);else if(R===0&&_==="..")a.push(".."),r=r.slice(2);else if(R===0&&_===".")a.push("."),r=r.slice(1);else{B.length>0&&a.push(B);let I=0;for(;(I=_.indexOf("../",I))!==-1;)a.push(".."),I+=3;for(I=0;(I=_.indexOf("./",I))!==-1;)(I===0||_[I-1]!==".")&&a.push("."),I+=2;let k=Y;for(;k.startsWith("../");)a.push(".."),k=k.slice(3);for(;k.startsWith("./");)a.push("."),k=k.slice(2);if(k===".."){a.push("..");break}else if(k==="."){a.push(".");break}else r=k}i.lastIndex=0}if(a.length===0){const o=c.split(t).filter(Boolean);a.push(...o)}let p=[];for(const o of a)h||g?p.push(...Te(o,u,l)):u?p.push(...F(o,u,l)):p.push(...q(o,l));return L&&(p=p.map(o=>l.has(o)?o:u&&o===o.toLocaleUpperCase(u)?o[0]+o.slice(1).toLocaleLowerCase(u):o.toUpperCase()===o&&!l.has(o)?o.slice(0,1)+o.slice(1).toLowerCase():o)),p},"splitByCase");export{Se as splitByCase};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, T as TitleCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, T as TitleCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * With Title Case all words are capitalized, except for minor words.
6
6
  * @example
@@ -1 +1 @@
1
- var c=Object.defineProperty;var i=(r,o)=>c(r,"name",{value:o,configurable:!0});import m from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var h=Object.defineProperty,j=i((r,o)=>h(r,"name",{value:o,configurable:!0}),"c");const A=new m(1e3);function w(r,o){if(typeof r!="string")return"";const a=o?.cache??!1,e=o?.cacheStore??A;let t;if(a&&(t=u(r,o)),a&&t&&e.has(t))return e.get(t);const n=p(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(l=>{const s=o?.locale?.startsWith("de")?d(l):l;return f(o?.locale?s.toLocaleLowerCase(o.locale):s.toLowerCase(),{locale:o?.locale})}).join(" ");return a&&t&&e.set(t,n),n}i(w,"g");j(w,"titleCase");export{w as default};
1
+ var c=Object.defineProperty;var i=(r,o)=>c(r,"name",{value:o,configurable:!0});import m from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as p}from"./split-by-case.js";import f from"./upper-first.js";import{a as u}from"../packem_shared/generate-cache-key-DPByFaMH.js";import{l as d}from"../packem_shared/normalize-german-eszett-AKfdw2MZ.js";var h=Object.defineProperty,j=i((r,o)=>h(r,"name",{value:o,configurable:!0}),"c");const A=new m(1e3);function w(r,o){if(typeof r!="string")return"";const a=o?.cache??!1,e=o?.cacheStore??A;let t;if(a&&(t=u(r,o)),a&&t&&e.has(t))return e.get(t);const n=p(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(l=>{const s=o?.locale?.startsWith("de")?d(l):l;return f(o?.locale?s.toLocaleLowerCase(o.locale):s.toLowerCase(),{locale:o?.locale})}).join(" ");return a&&t&&e.set(t,n),n}i(w,"g");j(w,"titleCase");export{w as default};
@@ -1,6 +1,6 @@
1
- import { C as CaseOptions, j as TrainCase } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { C as CaseOptions, j as TrainCase } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts a string to Train-Case.
6
6
  * @example
@@ -1 +1 @@
1
- var m=Object.defineProperty;var e=(o,r)=>m(o,"name",{value:r,configurable:!0});import l from"../packem_shared/LRUCache-Bjo6gsbC.js";import{splitByCase as p}from"./split-by-case.js";import c from"./upper-first.js";import{a as f}from"../packem_shared/generate-cache-key-DPByFaMH.js";import h from"../packem_shared/joinSegments-D27SxoCV.js";var d=Object.defineProperty,u=e((o,r)=>d(o,"name",{value:r,configurable:!0}),"i");const A=new l(1e3),C=u((o,r)=>{if(typeof o!="string")return"";const n=r?.cache??!1,i=r?.cacheStore??A;let t;if(n&&(t=f(o,r)),n&&t&&i.has(t))return i.get(t);const a=h(p(o,{handleAnsi:r?.handleAnsi,handleEmoji:r?.handleEmoji,knownAcronyms:r?.knownAcronyms,locale:r?.locale,normalize:r?.normalize,separators:void 0,stripAnsi:r?.stripAnsi,stripEmoji:r?.stripEmoji}).map(s=>c(s,{locale:r?.locale})),"-");return n&&t&&i.set(t,a),a},"trainCase");export{C as default};
1
+ var m=Object.defineProperty;var e=(o,r)=>m(o,"name",{value:r,configurable:!0});import l from"../packem_shared/LRUCache-Dpk7Vnfr.js";import{splitByCase as p}from"./split-by-case.js";import c from"./upper-first.js";import{a as f}from"../packem_shared/generate-cache-key-DPByFaMH.js";import h from"../packem_shared/joinSegments-D27SxoCV.js";var d=Object.defineProperty,u=e((o,r)=>d(o,"name",{value:r,configurable:!0}),"i");const A=new l(1e3),C=u((o,r)=>{if(typeof o!="string")return"";const n=r?.cache??!1,i=r?.cacheStore??A;let t;if(n&&(t=f(o,r)),n&&t&&i.has(t))return i.get(t);const a=h(p(o,{handleAnsi:r?.handleAnsi,handleEmoji:r?.handleEmoji,knownAcronyms:r?.knownAcronyms,locale:r?.locale,normalize:r?.normalize,separators:void 0,stripAnsi:r?.stripAnsi,stripEmoji:r?.stripEmoji}).map(s=>c(s,{locale:r?.locale})),"-");return n&&t&&i.set(t,a),a},"trainCase");export{C as default};
@@ -1,6 +1,6 @@
1
- import { L as LocaleOptions, U as UpperFirst } from "../packem_shared/types.d-BaFAOLxg.js";
2
- import "../packem_shared/types.d-CEMfJjRV.js";
3
- import "../packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { L as LocaleOptions, U as UpperFirst } from "../packem_shared/types.d-XxhGlCLZ.js";
2
+ import "../packem_shared/types.d-NJ4vcG-A.js";
3
+ import "../packem_shared/lru-cache.d-BVu2_gfi.js";
4
4
  /**
5
5
  * Converts first character to upper case.
6
6
  * @param value The string to convert.
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { default as snakeCase } from "./case/snake-case.js";
17
17
  export { type SplitOptions, splitByCase } from "./case/split-by-case.js";
18
18
  export { default as titleCase } from "./case/title-case.js";
19
19
  export { default as trainCase } from "./case/train-case.js";
20
- export { type a as CamelCase, type b as CapitalCase, type C as CaseOptions, type c as ConstantCase, type D as DotCase, type F as FlatCase, type d as FlipCase, type I as IdentifyCase, type K as KebabCase, type L as LocaleOptions, type e as LowerFirst, type N as NoCase, type P as PascalCase, type f as PascalSnakeCase, type g as PathCase, type S as SentenceCase, type h as SnakeCase, type i as SplitByCase, type T as TitleCase, type j as TrainCase, type U as UpperFirst } from "./packem_shared/types.d-BaFAOLxg.js";
20
+ export { type a as CamelCase, type b as CapitalCase, type C as CaseOptions, type c as ConstantCase, type D as DotCase, type F as FlatCase, type d as FlipCase, type I as IdentifyCase, type K as KebabCase, type L as LocaleOptions, type e as LowerFirst, type N as NoCase, type P as PascalCase, type f as PascalSnakeCase, type g as PathCase, type S as SentenceCase, type h as SnakeCase, type i as SplitByCase, type T as TitleCase, type j as TrainCase, type U as UpperFirst } from "./packem_shared/types.d-XxhGlCLZ.js";
21
21
  export { default as upperFirst } from "./case/upper-first.js";
22
22
  export { joinSegments } from "./case/index.js";
23
23
  export { type ClosestStringOptions, closestString } from "./closest-string.js";
@@ -27,14 +27,14 @@ export { truncate } from "./truncate.js";
27
27
  export { type StringTruncatedWidthOptions, type StringTruncatedWidthResult, getStringTruncatedWidth } from "./get-string-truncated-width.js";
28
28
  export { type StringWidthOptions, getStringWidth } from "./get-string-width.js";
29
29
  export { type Outdent, type Options as OutdentOptions, outdent } from "./outdent.js";
30
- import { O as OptionReplaceArray, I as IntervalArray, b as OptionsTransliterate } from "./packem_shared/types.d-CEMfJjRV.js";
31
- export { type A as All, type c as Any, type C as CharAt, type d as Charmap, type e as Concat, type E as EndsWith, type f as Includes, type g as Interval, type h as IsBooleanLiteral, type i as IsNumberLiteral, type a as IsStringLiteral, type j as IsStringLiteralArray, type J as Join, type L as Length, type M as Math, type N as NodeLocale, type k as OptionReplaceCombined, type l as OptionReplaceObject, type P as PadEnd, type m as PadStart, type R as Repeat, type n as Replace, type o as ReplaceAll, type p as Reverse, type q as Slice, type S as SlugifyOptions, type r as Split, type s as StartsWith, type T as ToLowerCase, type t as ToUpperCase, type u as Trim, type v as TrimEnd, type w as TrimStart } from "./packem_shared/types.d-CEMfJjRV.js";
30
+ import { O as OptionReplaceArray, a as IntervalArray, b as OptionsTransliterate } from "./packem_shared/types.d-NJ4vcG-A.js";
31
+ export { type A as All, type c as Any, type C as CharAt, type d as Charmap, type e as Concat, type E as EndsWith, type f as Includes, type g as Interval, type h as IsBooleanLiteral, type i as IsNumberLiteral, type I as IsStringLiteral, type j as IsStringLiteralArray, type J as Join, type L as Length, type M as Math, type N as NodeLocale, type k as OptionReplaceCombined, type l as OptionReplaceObject, type P as PadEnd, type m as PadStart, type R as Repeat, type n as Replace, type o as ReplaceAll, type p as Reverse, type q as Slice, type S as SlugifyOptions, type r as Split, type s as StartsWith, type T as ToLowerCase, type t as ToUpperCase, type u as Trim, type v as TrimEnd, type w as TrimStart } from "./packem_shared/types.d-NJ4vcG-A.js";
32
32
  export { type SliceOptions, slice } from "./slice.js";
33
33
  export { default as slugify } from "./slugify.js";
34
34
  export { escapeRegExp, findStringOccurrences, hasChinese, hasPunctuationOrSpace, inRange } from "./utilities.js";
35
35
  export { type WordSimilaritySortOptions, wordSimilaritySort } from "./word-similarity-sort.js";
36
36
  export { type WordWrapOptions, WrapMode, wordWrap } from "./word-wrap.js";
37
- import "./packem_shared/lru-cache.d-BsP6kbVJ.js";
37
+ import "./packem_shared/lru-cache.d-BVu2_gfi.js";
38
38
  /**
39
39
  * Get the count of `substring` in `value`.
40
40
  * @param value Content to search in. Will be coerced to string.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{alignText as r}from"./align-text.js";import{default as a}from"./case/camel-case.js";import{default as s}from"./case/capital-case.js";import{default as m}from"./case/constant-case.js";import{default as d}from"./case/dot-case.js";import{default as i}from"./case/flat-case.js";import{flipCase as u}from"./case/flip-case.js";import{default as C}from"./case/identify-case.js";import{kebabCase as S}from"./case/kebab-case.js";import{default as y}from"./case/lower-first.js";import{default as w}from"./case/no-case.js";import{default as F}from"./case/pascal-case.js";import{default as T}from"./case/pascal-snake-case.js";import{default as A}from"./case/path-case.js";import{default as R}from"./case/sentence-case.js";import{default as B}from"./case/snake-case.js";import{splitByCase as I}from"./case/split-by-case.js";import{default as N}from"./case/title-case.js";import{default as v}from"./case/train-case.js";import{default as D}from"./case/upper-first.js";import{default as H}from"./packem_shared/joinSegments-D27SxoCV.js";import{closestString as K}from"./closest-string.js";import{compareSimilarity as Q}from"./compare-similarity.js";import{countOccurrences as V}from"./packem_shared/countOccurrences-DIHSCdcG.js";import{direction as Y}from"./packem_shared/direction-dtczwUOE.js";import{excerpt as _}from"./packem_shared/excerpt-DhV2yoHG.js";import{getStringTruncatedWidth as ee}from"./get-string-truncated-width.js";import{getStringWidth as re}from"./get-string-width.js";import{default as ae}from"./packem_shared/isFullwidthCodePoint-DJd4PBMe.js";import{closestN as se}from"./packem_shared/closestN-Vd5oNJy_.js";import{outdent as me}from"./outdent.js";import{default as de}from"./packem_shared/replaceString-aq-C7Wor.js";import{slice as ie}from"./slice.js";import{default as ue}from"./slugify.js";import{default as Ce}from"./packem_shared/transliterate-D1p1yYE7.js";import{truncate as Se}from"./truncate.js";import{escapeRegExp as ye,findStringOccurrences as We,hasChinese as we,hasPunctuationOrSpace as ke,inRange as Fe}from"./utilities.js";import{wordSimilaritySort as Te}from"./word-similarity-sort.js";import{WrapMode as Ae,wordWrap as Pe}from"./word-wrap.js";import{default as je}from"./packem_shared/indent-CDlPQmpe.js";import{default as Ee}from"./packem_shared/redent-BECVOaZp.js";import{dedent as Me,default as Ne}from"./packem_shared/stripIndent-Dt8hSxVM.js";import{closest as ve,distance as ze}from"./packem_shared/closest-uarbVSbs.js";import{eastAsianWidth as Ge,eastAsianWidthType as He}from"./packem_shared/eastAsianWidthType-GZeXsSGs.js";export{Ae as WrapMode,r as alignText,a as camelCase,s as capitalCase,ve as closest,se as closestN,K as closestString,Q as compareSimilarity,m as constantCase,V as countOccurrences,Me as dedent,Y as direction,ze as distance,d as dotCase,Ge as eastAsianWidth,He as eastAsianWidthType,ye as escapeRegExp,_ as excerpt,We as findStringOccurrences,i as flatCase,u as flipCase,ee as getStringTruncatedWidth,re as getStringWidth,we as hasChinese,ke as hasPunctuationOrSpace,C as identifyCase,Fe as inRange,je as indent,ae as isFullwidthCodePoint,H as joinSegments,S as kebabCase,y as lowerFirst,w as noCase,me as outdent,F as pascalCase,T as pascalSnakeCase,A as pathCase,Ee as redent,de as replaceString,R as sentenceCase,ie as slice,ue as slugify,B as snakeCase,I as splitByCase,Ne as stripIndent,N as titleCase,v as trainCase,Ce as transliterate,Se as truncate,D as upperFirst,Te as wordSimilaritySort,Pe as wordWrap};
1
+ import{alignText as r}from"./align-text.js";import{default as a}from"./case/camel-case.js";import{default as s}from"./case/capital-case.js";import{default as m}from"./case/constant-case.js";import{default as d}from"./case/dot-case.js";import{default as i}from"./case/flat-case.js";import{flipCase as u}from"./case/flip-case.js";import{default as C}from"./case/identify-case.js";import{kebabCase as S}from"./case/kebab-case.js";import{default as y}from"./case/lower-first.js";import{default as w}from"./case/no-case.js";import{default as F}from"./case/pascal-case.js";import{default as T}from"./case/pascal-snake-case.js";import{default as A}from"./case/path-case.js";import{default as R}from"./case/sentence-case.js";import{default as B}from"./case/snake-case.js";import{splitByCase as I}from"./case/split-by-case.js";import{default as N}from"./case/title-case.js";import{default as v}from"./case/train-case.js";import{default as D}from"./case/upper-first.js";import{default as H}from"./packem_shared/joinSegments-D27SxoCV.js";import{closestString as K}from"./closest-string.js";import{compareSimilarity as Q}from"./compare-similarity.js";import{countOccurrences as V}from"./packem_shared/countOccurrences-DIHSCdcG.js";import{direction as Y}from"./packem_shared/direction-dtczwUOE.js";import{excerpt as _}from"./packem_shared/excerpt-DhV2yoHG.js";import{getStringTruncatedWidth as ee}from"./get-string-truncated-width.js";import{getStringWidth as re}from"./get-string-width.js";import{default as ae}from"./packem_shared/isFullwidthCodePoint-DJd4PBMe.js";import{closestN as se}from"./packem_shared/closestN-Daviv9V6.js";import{outdent as me}from"./outdent.js";import{default as de}from"./packem_shared/replaceString-aq-C7Wor.js";import{slice as ie}from"./slice.js";import{default as ue}from"./slugify.js";import{default as Ce}from"./packem_shared/transliterate-D1p1yYE7.js";import{truncate as Se}from"./truncate.js";import{escapeRegExp as ye,findStringOccurrences as We,hasChinese as we,hasPunctuationOrSpace as ke,inRange as Fe}from"./utilities.js";import{wordSimilaritySort as Te}from"./word-similarity-sort.js";import{WrapMode as Ae,wordWrap as Pe}from"./word-wrap.js";import{default as je}from"./packem_shared/indent-CDlPQmpe.js";import{default as Ee}from"./packem_shared/redent-BECVOaZp.js";import{dedent as Me,default as Ne}from"./packem_shared/stripIndent-Dt8hSxVM.js";import{closest as ve,distance as ze}from"./packem_shared/closest-uarbVSbs.js";import{eastAsianWidth as Ge,eastAsianWidthType as He}from"./packem_shared/eastAsianWidthType-GZeXsSGs.js";export{Ae as WrapMode,r as alignText,a as camelCase,s as capitalCase,ve as closest,se as closestN,K as closestString,Q as compareSimilarity,m as constantCase,V as countOccurrences,Me as dedent,Y as direction,ze as distance,d as dotCase,Ge as eastAsianWidth,He as eastAsianWidthType,ye as escapeRegExp,_ as excerpt,We as findStringOccurrences,i as flatCase,u as flipCase,ee as getStringTruncatedWidth,re as getStringWidth,we as hasChinese,ke as hasPunctuationOrSpace,C as identifyCase,Fe as inRange,je as indent,ae as isFullwidthCodePoint,H as joinSegments,S as kebabCase,y as lowerFirst,w as noCase,me as outdent,F as pascalCase,T as pascalSnakeCase,A as pathCase,Ee as redent,de as replaceString,R as sentenceCase,ie as slice,ue as slugify,B as snakeCase,I as splitByCase,Ne as stripIndent,N as titleCase,v as trainCase,Ce as transliterate,Se as truncate,D as upperFirst,Te as wordSimilaritySort,Pe as wordWrap};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var a=(c,e)=>s(c,"name",{value:e,configurable:!0});var i=Object.defineProperty,r=a((c,e)=>i(c,"name",{value:e,configurable:!0}),"a");class n{static{a(this,"s")}static{r(this,"LRUCache")}capacity;cache;constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const h=this.cache.keys().next().value;h!==void 0&&this.cache.delete(h)}this.cache.set(e,t)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}}export{n as default};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var a=(e,t)=>u(e,"name",{value:t,configurable:!0});import{distance as p}from"./closest-uarbVSbs.js";import{closest as A}from"./closest-uarbVSbs.js";var v=Object.defineProperty,g=a((e,t)=>v(e,"name",{value:t,configurable:!0}),"l");const h=g((e,t,r)=>{const s=Array.from({length:r}).fill(1/0),l=Array.from({length:r}).fill(void 0);for(const i of t){const f=i;let c=p(e,f),n=f;for(let o=0;o<r;o+=1)if(c<s[o]){const m=s[o],d=l[o];s[o]=c,l[o]=n,c=m,n=d??""}}return l},"closestN");export{A as closest,h as closestN,p as distance};
1
+ var u=Object.defineProperty;var a=(e,t)=>u(e,"name",{value:t,configurable:!0});import{distance as p}from"./closest-uarbVSbs.js";import{closest as A}from"./closest-uarbVSbs.js";var v=Object.defineProperty,g=a((e,t)=>v(e,"name",{value:t,configurable:!0}),"l");const h=g((e,t,r)=>{const s=Array.from({length:r}).fill(1/0),l=Array.from({length:r}).fill(void 0);for(const i of t){const f=i;let c=p(e,f),n=f;for(let o=0;o<r;o+=1)if(c<s[o]){const m=s[o],d=l[o];s[o]=c,l[o]=n,c=m,n=d}}return l},"closestN");export{A as closest,h as closestN,p as distance};
@@ -1,7 +1,6 @@
1
1
  declare class LRUCache<K, V> {
2
2
  private readonly capacity;
3
3
  private readonly cache;
4
- private keyOrder;
5
4
  constructor(capacity: number);
6
5
  get(key: K): V | undefined;
7
6
  has(key: K): boolean;
@@ -343,4 +343,4 @@ interface SlugifyOptions extends OptionsTransliterate {
343
343
  */
344
344
  uppercase?: boolean;
345
345
  }
346
- export { All as A, CharAt as C, EndsWith as E, IntervalArray as I, Join as J, Length as L, Math as M, NodeLocale as N, OptionReplaceArray as O, PadEnd as P, Repeat as R, SlugifyOptions as S, ToLowerCase as T, IsStringLiteral as a, OptionsTransliterate as b, Any as c, Charmap as d, Concat as e, Includes as f, Interval as g, IsBooleanLiteral as h, IsNumberLiteral as i, IsStringLiteralArray as j, OptionReplaceCombined as k, OptionReplaceObject as l, PadStart as m, Replace as n, ReplaceAll as o, Reverse as p, Slice as q, Split as r, StartsWith as s, ToUpperCase as t, Trim as u, TrimEnd as v, TrimStart as w };
346
+ export { All as A, CharAt as C, EndsWith as E, IsStringLiteral as I, Join as J, Length as L, Math as M, NodeLocale as N, OptionReplaceArray as O, PadEnd as P, Repeat as R, SlugifyOptions as S, ToLowerCase as T, IntervalArray as a, OptionsTransliterate as b, Any as c, Charmap as d, Concat as e, Includes as f, Interval as g, IsBooleanLiteral as h, IsNumberLiteral as i, IsStringLiteralArray as j, OptionReplaceCombined as k, OptionReplaceObject as l, PadStart as m, Replace as n, ReplaceAll as o, Reverse as p, Slice as q, Split as r, StartsWith as s, ToUpperCase as t, Trim as u, TrimEnd as v, TrimStart as w };
@@ -1,5 +1,5 @@
1
- import { a as IsStringLiteral, N as NodeLocale } from "./types.d-CEMfJjRV.js";
2
- import { L as LRUCache } from "./lru-cache.d-BsP6kbVJ.js";
1
+ import { I as IsStringLiteral, N as NodeLocale } from "./types.d-NJ4vcG-A.js";
2
+ import { L as LRUCache } from "./lru-cache.d-BVu2_gfi.js";
3
3
  /**
4
4
  * Valid characters used to split strings into words.
5
5
  * Used by various case conversion functions to identify word boundaries.
package/dist/slice.js CHANGED
@@ -1 +1 @@
1
- var _=Object.defineProperty;var w=(t,c)=>_(t,"name",{value:c,configurable:!0});import{j as v,k as A,g as O}from"./packem_shared/constants-DmzZF6_u.js";import{getStringWidth as k}from"./get-string-width.js";import j from"./packem_shared/LRUCache-Bjo6gsbC.js";var N=Object.defineProperty,b=w((t,c)=>N(t,"name",{value:c,configurable:!0}),"y");const y=new j(100),F=new Intl.Segmenter("en",{granularity:"grapheme"}),M=/^[\u0000-\u007F]*$/,P=new Set(["0","22","23","24","27","28","29","39","49"]),V=new Set(["1","3","4","7","8","9"]),E=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),S=b(t=>t>="30"&&t<="37"||t>="90"&&t<="97"||t.startsWith("38;"),"isForegroundColor"),I=b(t=>t>="40"&&t<="47"||t>="100"&&t<="107"||t.startsWith("48;"),"isBackgroundColor"),$=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],L=b((t,c)=>{let l=-1;for(const d of c){const h=t.indexOf(d);h!==-1&&(l===-1||h<l)&&(l=h)}return l},"findFirstPositionOfAny"),C=b((t,c)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:k(t,c.width)}];const l=y.get(t);if(l)return l;const d=[],h=[];let W=0,m;for(O.lastIndex=0;(m=O.exec(t))!==null;){const r=m[0];d.push(t.slice(W,m.index)),h.push(r),W=m.index+r.length}W<t.length&&d.push(t.slice(W));const a=[];for(const r of h){if(r==="\x1B[0m"||r==="\x1B]8;;\x07"){a.push(r);continue}if(r.startsWith("\x1B[")&&r.endsWith("m")){const x=r.slice(2,-1);if(P.has(x)){a.push(r);continue}}}const s=new Set,B=[];for(const[r,x]of d.entries()){if(r>0&&h[r-1]){const n=h[r-1];if(n==="\x1B[0m")s.clear();else if(n==="\x1B]8;;\x07"){for(const i of s)if(i.startsWith("\x1B]8;;")&&!i.endsWith("\x1B]8;;\x07")){s.delete(i);break}}else if(n.startsWith("\x1B[")&&n.endsWith("m")){const i=n.slice(2,-1);if(i==="39"){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(S(f)){s.delete(e);break}}}else if(i==="49"){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(I(f)){s.delete(e);break}}}else if(E.has(i)){const e=E.get(i);for(const f of s)if(f===`\x1B[${e}m`){s.delete(f);break}}else{if(S(i)){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(S(f)){s.delete(e);break}}}else if(I(i)){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(I(f)){s.delete(e);break}}}else if(V.has(i)){const e=`\x1B[${i}m`;s.has(e)&&s.delete(e)}s.add(n)}}else if(n.startsWith("\x1B]8;;")&&!n.endsWith("\x1B]8;;\x07")){for(const i of s)if(i.startsWith("\x1B]8;;")&&!i.endsWith("\x1B]8;;\x07")){s.delete(i);break}s.add(n)}}if(x==="")continue;let u="";if(s.size>0)if(a.includes("\x1B[0m"))u="\x1B[0m";else{const n=[];let i=!1;for(const o of s)if(o.startsWith("\x1B]8;;")&&!o.endsWith("\x1B]8;;\x07")){i=!0;break}i&&a.includes("\x1B]8;;\x07")&&n.push("\x1B]8;;\x07");let e=!1,f=!1;for(const o of s)if(o.startsWith("\x1B[")&&o.endsWith("m")){const g=o.slice(2,-1);S(g)?e=!0:I(g)&&(f=!0)}if(e&&f){const o=L(t,["\x1B[3","\x1B[9","\x1B[38;"]),g=L(t,["\x1B[4","\x1B[10","\x1B[48;"]);o>=0&&g>=0?o>g?n.push("\x1B[39m","\x1B[49m"):n.push("\x1B[49m","\x1B[39m"):n.push("\x1B[39m","\x1B[49m")}else e&&n.push("\x1B[39m"),f&&n.push("\x1B[49m");e&&f&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(n.length-=2,n.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(n.length-=2,n.push("\x1B[49m","\x1B[39m")));const R=$.filter(o=>s.has(o.open)).map(o=>({position:t.indexOf(o.open),style:o})).filter(o=>o.position>=0).toSorted((o,g)=>g.position-o.position);for(const o of R){const g=o;a.includes(g.style.close)&&n.push(g.style.close)}u=n.join("")}const p=[...s].join("");B.push({after:u,before:p,content:x,visibleLength:k(x,{fullWidth:1,wideWidth:1})})}return y.set(t,B),B},"processIntoStyledSegments"),D=b((t,c,l,d)=>{const h=[...d.segmenter.segment(t)],W=[];let m=0,a=!1;for(const s of h){const B=k(s.segment,d.width),r=m,x=m+B;if(!a)if(r<c){m=x;continue}else a=!0;if(r>=l||x>l)break;W.push(s.segment),m=x}return W.join("")},"fastSlice"),K=b((t,c=0,l=Number.MAX_SAFE_INTEGER,d={})=>{const h={segmenter:F,...d};if(c>=l||t==="")return"";const W=k(t,h.width);if(c===0&&l>=W)return t;if(c<0||l<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return M.test(t)?t.slice(c,l):D(t,c,l,h);if(v.lastIndex=0,A.lastIndex=0,!v.test(t)&&!A.test(t))return t;const m=C(t,h);if(m.length===0)return"";let a=0;const s=[];for(const[x,u]of m.entries()){const p=a,n=a+u.visibleLength;if(n>c&&p<l){const i=Math.max(0,c-p),e=Math.min(u.visibleLength,l-p);s.push({end:e,index:x,segment:u,start:i})}a=n}if(s.length===0)return"";const B=[],r=s[0].segment;B.push(r.before);for(let x=0;x<s.length;x++){const{end:u,segment:p,start:n}=s[x];if(n===0&&u===p.visibleLength)B.push(p.content);else{const i=[...h.segmenter.segment(p.content)];B.push(i.slice(n,u).map(e=>e.segment).join(""))}if(x<s.length-1){const i=s[x+1].segment,e=p.after,f=i.before;e!==f&&(e||f)&&B.push(e,f)}}return B.push(s.at(-1).segment.after),B.join("")},"slice");export{K as slice};
1
+ var _=Object.defineProperty;var w=(t,c)=>_(t,"name",{value:c,configurable:!0});import{j as v,k as A,g as O}from"./packem_shared/constants-DmzZF6_u.js";import{getStringWidth as k}from"./get-string-width.js";import j from"./packem_shared/LRUCache-Dpk7Vnfr.js";var N=Object.defineProperty,b=w((t,c)=>N(t,"name",{value:c,configurable:!0}),"y");const y=new j(100),F=new Intl.Segmenter("en",{granularity:"grapheme"}),M=/^[\u0000-\u007F]*$/,P=new Set(["0","22","23","24","27","28","29","39","49"]),V=new Set(["1","3","4","7","8","9"]),E=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),S=b(t=>t>="30"&&t<="37"||t>="90"&&t<="97"||t.startsWith("38;"),"isForegroundColor"),I=b(t=>t>="40"&&t<="47"||t>="100"&&t<="107"||t.startsWith("48;"),"isBackgroundColor"),$=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],L=b((t,c)=>{let l=-1;for(const d of c){const h=t.indexOf(d);h!==-1&&(l===-1||h<l)&&(l=h)}return l},"findFirstPositionOfAny"),C=b((t,c)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:k(t,c.width)}];const l=y.get(t);if(l)return l;const d=[],h=[];let W=0,m;for(O.lastIndex=0;(m=O.exec(t))!==null;){const r=m[0];d.push(t.slice(W,m.index)),h.push(r),W=m.index+r.length}W<t.length&&d.push(t.slice(W));const a=[];for(const r of h){if(r==="\x1B[0m"||r==="\x1B]8;;\x07"){a.push(r);continue}if(r.startsWith("\x1B[")&&r.endsWith("m")){const x=r.slice(2,-1);if(P.has(x)){a.push(r);continue}}}const s=new Set,B=[];for(const[r,x]of d.entries()){if(r>0&&h[r-1]){const n=h[r-1];if(n==="\x1B[0m")s.clear();else if(n==="\x1B]8;;\x07"){for(const i of s)if(i.startsWith("\x1B]8;;")&&!i.endsWith("\x1B]8;;\x07")){s.delete(i);break}}else if(n.startsWith("\x1B[")&&n.endsWith("m")){const i=n.slice(2,-1);if(i==="39"){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(S(f)){s.delete(e);break}}}else if(i==="49"){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(I(f)){s.delete(e);break}}}else if(E.has(i)){const e=E.get(i);for(const f of s)if(f===`\x1B[${e}m`){s.delete(f);break}}else{if(S(i)){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(S(f)){s.delete(e);break}}}else if(I(i)){for(const e of s)if(e.startsWith("\x1B[")&&e.endsWith("m")){const f=e.slice(2,-1);if(I(f)){s.delete(e);break}}}else if(V.has(i)){const e=`\x1B[${i}m`;s.has(e)&&s.delete(e)}s.add(n)}}else if(n.startsWith("\x1B]8;;")&&!n.endsWith("\x1B]8;;\x07")){for(const i of s)if(i.startsWith("\x1B]8;;")&&!i.endsWith("\x1B]8;;\x07")){s.delete(i);break}s.add(n)}}if(x==="")continue;let u="";if(s.size>0)if(a.includes("\x1B[0m"))u="\x1B[0m";else{const n=[];let i=!1;for(const o of s)if(o.startsWith("\x1B]8;;")&&!o.endsWith("\x1B]8;;\x07")){i=!0;break}i&&a.includes("\x1B]8;;\x07")&&n.push("\x1B]8;;\x07");let e=!1,f=!1;for(const o of s)if(o.startsWith("\x1B[")&&o.endsWith("m")){const g=o.slice(2,-1);S(g)?e=!0:I(g)&&(f=!0)}if(e&&f){const o=L(t,["\x1B[3","\x1B[9","\x1B[38;"]),g=L(t,["\x1B[4","\x1B[10","\x1B[48;"]);o>=0&&g>=0?o>g?n.push("\x1B[39m","\x1B[49m"):n.push("\x1B[49m","\x1B[39m"):n.push("\x1B[39m","\x1B[49m")}else e&&n.push("\x1B[39m"),f&&n.push("\x1B[49m");e&&f&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(n.length-=2,n.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(n.length-=2,n.push("\x1B[49m","\x1B[39m")));const R=$.filter(o=>s.has(o.open)).map(o=>({position:t.indexOf(o.open),style:o})).filter(o=>o.position>=0).toSorted((o,g)=>g.position-o.position);for(const o of R){const g=o;a.includes(g.style.close)&&n.push(g.style.close)}u=n.join("")}const p=[...s].join("");B.push({after:u,before:p,content:x,visibleLength:k(x,{fullWidth:1,wideWidth:1})})}return y.set(t,B),B},"processIntoStyledSegments"),D=b((t,c,l,d)=>{const h=[...d.segmenter.segment(t)],W=[];let m=0,a=!1;for(const s of h){const B=k(s.segment,d.width),r=m,x=m+B;if(!a)if(r<c){m=x;continue}else a=!0;if(r>=l||x>l)break;W.push(s.segment),m=x}return W.join("")},"fastSlice"),K=b((t,c=0,l=Number.MAX_SAFE_INTEGER,d={})=>{const h={segmenter:F,...d};if(c>=l||t==="")return"";const W=k(t,h.width);if(c===0&&l>=W)return t;if(c<0||l<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return M.test(t)?t.slice(c,l):D(t,c,l,h);if(v.lastIndex=0,A.lastIndex=0,!v.test(t)&&!A.test(t))return t;const m=C(t,h);if(m.length===0)return"";let a=0;const s=[];for(const[x,u]of m.entries()){const p=a,n=a+u.visibleLength;if(n>c&&p<l){const i=Math.max(0,c-p),e=Math.min(u.visibleLength,l-p);s.push({end:e,index:x,segment:u,start:i})}a=n}if(s.length===0)return"";const B=[],r=s[0].segment;B.push(r.before);for(let x=0;x<s.length;x++){const{end:u,segment:p,start:n}=s[x];if(n===0&&u===p.visibleLength)B.push(p.content);else{const i=[...h.segmenter.segment(p.content)];B.push(i.slice(n,u).map(e=>e.segment).join(""))}if(x<s.length-1){const i=s[x+1].segment,e=p.after,f=i.before;e!==f&&(e||f)&&B.push(e,f)}}return B.push(s.at(-1).segment.after),B.join("")},"slice");export{K as slice};
package/dist/slugify.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SlugifyOptions } from "./packem_shared/types.d-CEMfJjRV.js";
1
+ import { S as SlugifyOptions } from "./packem_shared/types.d-NJ4vcG-A.js";
2
2
  /**
3
3
  * Converts a string into a URL-friendly slug.
4
4
  *
package/dist/truncate.js CHANGED
@@ -1 +1 @@
1
- var N=Object.defineProperty;var T=(r,i)=>N(r,"name",{value:i,configurable:!0});import{getStringTruncatedWidth as x}from"./get-string-truncated-width.js";import{getStringWidth as O}from"./get-string-width.js";import{slice as h}from"./slice.js";var A=Object.defineProperty,g=T((r,i)=>A(r,"name",{value:i,configurable:!0}),"f");const b="…",$=3,u=g((r,i,t=!1)=>{if(r.charAt(i)===" ")return i;const e=t?1:-1,d=Math.min($,t?r.length-i:i);for(let w=1;w<=d;w++){const l=i+w*e;if(r.charAt(l)===" ")return l}return i},"findNearestSpace"),f=g((r,i,t)=>x(r,{...t,ellipsis:"",ellipsisWidth:0,limit:i}).index,"widthToIndex"),m=g((r,i,t)=>O(r.slice(0,i),t),"indexToWidth"),B=g((r,i,t={})=>{if(typeof r!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof r}`);if(typeof i!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof i}`);if(r===""||i<=0)return"";const e=r.normalize("NFC"),{ellipsis:d=b,position:w="end",preferTruncationOnSpace:l=!1}=t;let o=t.ellipsisWidth??d===b?1:void 0;o??=x(d,{...t.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:n}=x(e,{...t.width,ellipsis:d,ellipsisWidth:o});if(n<=i)return e;switch(w){case"end":{if(l){const p=i-o,a=f(e,p,t.width),s=u(e,a),c=m(e,s,t.width);return h(e,0,c,{width:t.width})+d}return h(e,0,i-o,{width:t.width})+d}case"middle":{const p=Math.floor(i/2),a=Math.max(0,i-o),s=Math.min(p,a),c=Math.max(0,a-s);if(l){const y=f(e,s,t.width),I=u(e,y),E=m(e,I,t.width),W=n-c,S=f(e,W,t.width),v=u(e,S,!0),M=m(e,v,t.width);return h(e,0,E,{width:t.width})+d+h(e,M,n,{width:t.width}).trim()}return h(e,0,s,{width:t.width})+d+h(e,n-c,n,{width:t.width})}case"start":{if(l){const p=n-i+o,a=f(e,p,t.width),s=u(e,a,!0),c=m(e,s,t.width);return d+h(e,c,n,{width:t.width}).trim()}return d+h(e,n-i+o,n,{width:t.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${w}'`)}},"truncate");export{B as truncate};
1
+ var N=Object.defineProperty;var T=(r,i)=>N(r,"name",{value:i,configurable:!0});import{getStringTruncatedWidth as x}from"./get-string-truncated-width.js";import{getStringWidth as O}from"./get-string-width.js";import{slice as h}from"./slice.js";var A=Object.defineProperty,g=T((r,i)=>A(r,"name",{value:i,configurable:!0}),"f");const b="…",$=3,u=g((r,i,t=!1)=>{if(r.charAt(i)===" ")return i;const e=t?1:-1,d=Math.min($,t?r.length-i:i);for(let w=1;w<=d;w++){const l=i+w*e;if(r.charAt(l)===" ")return l}return i},"findNearestSpace"),f=g((r,i,t)=>x(r,{...t,ellipsis:"",ellipsisWidth:0,limit:i}).index,"widthToIndex"),m=g((r,i,t)=>O(r.slice(0,i),t),"indexToWidth"),B=g((r,i,t={})=>{if(typeof r!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof r}`);if(typeof i!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof i}`);if(r===""||i<=0)return"";const e=r.normalize("NFC"),{ellipsis:d=b,position:w="end",preferTruncationOnSpace:l=!1}=t;let o=t.ellipsisWidth??(d===b?1:void 0);o??=x(d,{...t.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:n}=x(e,{...t.width,ellipsis:d,ellipsisWidth:o});if(n<=i)return e;switch(w){case"end":{if(l){const p=i-o,a=f(e,p,t.width),s=u(e,a),c=m(e,s,t.width);return h(e,0,c,{width:t.width})+d}return h(e,0,i-o,{width:t.width})+d}case"middle":{const p=Math.floor(i/2),a=Math.max(0,i-o),s=Math.min(p,a),c=Math.max(0,a-s);if(l){const y=f(e,s,t.width),I=u(e,y),E=m(e,I,t.width),W=n-c,S=f(e,W,t.width),v=u(e,S,!0),M=m(e,v,t.width);return h(e,0,E,{width:t.width})+d+h(e,M,n,{width:t.width}).trim()}return h(e,0,s,{width:t.width})+d+h(e,n-c,n,{width:t.width})}case"start":{if(l){const p=n-i+o,a=f(e,p,t.width),s=u(e,a,!0),c=m(e,s,t.width);return d+h(e,c,n,{width:t.width}).trim()}return d+h(e,n-i+o,n,{width:t.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${w}'`)}},"truncate");export{B as truncate};
@@ -1,5 +1,5 @@
1
- import { I as IntervalArray } from "./packem_shared/types.d-CEMfJjRV.js";
2
- export { L as LRUCache } from "./packem_shared/lru-cache.d-BsP6kbVJ.js";
1
+ import { a as IntervalArray } from "./packem_shared/types.d-NJ4vcG-A.js";
2
+ export { L as LRUCache } from "./packem_shared/lru-cache.d-BVu2_gfi.js";
3
3
  /**
4
4
  * Escapes characters with special meaning in regular expressions.
5
5
  * @param char The string to escape.
package/dist/utilities.js CHANGED
@@ -1 +1 @@
1
- var i=Object.defineProperty;var c=(u,t)=>i(u,"name",{value:t,configurable:!0});import{default as B}from"./packem_shared/LRUCache-Bjo6gsbC.js";var p=Object.defineProperty,n=c((u,t)=>p(u,"name",{value:t,configurable:!0}),"D");const E=/[.*+?^${}()|[\]\\]/g,f=/[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DBF\u4E00-\u9FFC\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]/,h=/[\p{P}\p{Z}]/u,g=n(u=>u.replaceAll(E,String.raw`\$&`),"escapeRegExp"),l=n((u,t)=>t.some(F=>u>=F[0]&&u<=F[1]),"inRange"),A=n(u=>f.test(u),"hasChinese"),d=n(u=>h.test(u),"hasPunctuationOrSpace"),x=n((u,t)=>{const F=[];if(!Array.isArray(t))return F;if(t.forEach(D=>{if(typeof D!="string"||D.length===0)return;let r=0,a;for(;(a=u.indexOf(D,r))>-1;){const o=a+D.length-1;F.push([a,o]),r=a+1}}),F.length===0)return[];F.sort((D,r)=>D[0]-r[0]);const s=[];let e;for(const D of F)e===void 0?e=[...D]:D[0]<=e[1]+1?e[1]=Math.max(e[1],D[1]):(s.push(e),e=[...D]);return e!==void 0&&s.push(e),s},"findStringOccurrences");export{B as LRUCache,g as escapeRegExp,x as findStringOccurrences,A as hasChinese,d as hasPunctuationOrSpace,l as inRange};
1
+ var i=Object.defineProperty;var c=(u,t)=>i(u,"name",{value:t,configurable:!0});import{default as B}from"./packem_shared/LRUCache-Dpk7Vnfr.js";var p=Object.defineProperty,n=c((u,t)=>p(u,"name",{value:t,configurable:!0}),"D");const E=/[.*+?^${}()|[\]\\]/g,f=/[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DBF\u4E00-\u9FFC\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]/,h=/[\p{P}\p{Z}]/u,g=n(u=>u.replaceAll(E,String.raw`\$&`),"escapeRegExp"),l=n((u,t)=>t.some(F=>u>=F[0]&&u<=F[1]),"inRange"),A=n(u=>f.test(u),"hasChinese"),d=n(u=>h.test(u),"hasPunctuationOrSpace"),x=n((u,t)=>{const F=[];if(!Array.isArray(t))return F;if(t.forEach(D=>{if(typeof D!="string"||D.length===0)return;let r=0,a;for(;(a=u.indexOf(D,r))>-1;){const o=a+D.length-1;F.push([a,o]),r=a+1}}),F.length===0)return[];F.sort((D,r)=>D[0]-r[0]);const s=[];let e;for(const D of F)e===void 0?e=[...D]:D[0]<=e[1]+1?e[1]=Math.max(e[1],D[1]):(s.push(e),e=[...D]);return e!==void 0&&s.push(e),s},"findStringOccurrences");export{B as LRUCache,g as escapeRegExp,x as findStringOccurrences,A as hasChinese,d as hasPunctuationOrSpace,l as inRange};
package/dist/word-wrap.js CHANGED
@@ -1,8 +1,8 @@
1
- var P=Object.defineProperty;var d=(t,e)=>P(t,"name",{value:e,configurable:!0});import{O as A,P as k,Q as x,S as b,T as j,U as D,V as N,W as $,X as q}from"./packem_shared/constants-DmzZF6_u.js";import{getStringWidth as m}from"./get-string-width.js";var G=Object.defineProperty,L=d((t,e)=>G(t,"name",{value:e,configurable:!0}),"a");const K=/\x1B\[(\d+)m/;class T{static{d(this,"d")}static{L(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const n=K.exec(e);if(!n)return;const r=Number.parseInt(n[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=e;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(r)){const u={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];u&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(u)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const u=n[r];u&&e.push(u)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}var U=Object.defineProperty,w=d((t,e)=>U(t,"name",{value:e,configurable:!0}),"o");const C=w((t,e)=>{if(!A.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=t.slice(e+1,e+1+k.length).join("")===k;return{isInsideEscape:n,isInsideLinkEscape:r}},"checkEscapeSequence"),V=w((t,e={})=>{const n=new T;let r="",u=!1,i="",s="",c=!1;const o=[...t];for(let l=0;l<o.length;l++){const a=o[l];if(a&&A.has(a)){if(r){const g=e.getWidth?.(r)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(c&&(S.isHyperlink=!0,S.hyperlinkUrl=s),e.onSegment?.(S,n)===!1)return;r=""}u=!0,i=a;const p=C(o,l),{isInsideLinkEscape:H}=p;if(H){let g=l+1;for(s="";g<o.length;){const _=o[g];if(_===b)break;s+=_,g+=1}s=s.slice(4);const S={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,n)===!1)return;l=g,c=!0,u=!1,i="";continue}if(l+1<o.length&&o[l+1]==="\\"&&c){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,n)===!1)return;c=!1,s="",l+=1,u=!1,i="";continue}}if(u){if(i!==a&&(i+=a),a===x){u=!1,n.processEscape(i);const p={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(e.onSegment?.(p,n)===!1)return;i=""}continue}r+=a;const h=e.getWidth?.(r)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:r,width:h};if(c&&(f.isHyperlink=!0,f.hyperlinkUrl=s),e.onSegment?.(f,n)===!1)return;r=""}if(r){const l=e.getWidth?.(r)??0,a={isEscapeSequence:!1,isGrapheme:!0,text:r,width:l};c&&(a.isHyperlink=!0,a.hyperlinkUrl=s),e.onSegment?.(a,n)}if(i){const l={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};e.onSegment?.(l,n)}},"processAnsiString");var M=Object.defineProperty,Z=d((t,e)=>M(t,"name",{value:e,configurable:!0}),"t$1");const W=Z(t=>`${A.values().next().value}${j}${String(t)}${x}`,"wrapAnsiCode");var z=Object.defineProperty,Q=d((t,e)=>z(t,"name",{value:e,configurable:!0}),"s");const F=Q(t=>`${A.values().next().value}${k}${t}${b}`,"wrapAnsiHyperlink");var X=Object.defineProperty,J=d((t,e)=>X(t,"name",{value:e,configurable:!0}),"l");const Y=J(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",n,r;const u=t.join(`
2
- `),i=[...u];let s=0;for(const[c,o]of i.entries()){if(e+=o,A.has(o)){const a=D.exec(u.slice(s))?.groups??{};if(a.code!==void 0){const h=Number.parseFloat(a.code);n=h===$?void 0:h}else a.uri!==void 0&&(r=a.uri.length===0?void 0:a.uri)}const l=N.get(Number(n));i[c+1]===`
3
- `?(r&&(e+=F("")),n&&l&&(e+=W(l))):o===`
4
- `&&(n&&l&&(e+=W(n)),r&&(e+=F(r))),s+=o.length}return e},"preserveAnsi");var ee=Object.defineProperty,E=d((t,e)=>ee(t,"name",{value:e,configurable:!0}),"f");const I=/(?=\s)|(?<=\s)/,y=/^\s+$/,R=E(t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},"resetAnsiAtLineBreak"),v=E(t=>{const e=t.split(" ");let n=e.length;for(;n>0&&m(e[n-1])===0;)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},"stringVisibleTrimSpacesRight"),O=E((t,e,n)=>{if(t.length===0)return[""];if(e<=0)return[t];const r=[],u=new T;let i="",s=0,c=!1,o=!1,l="",a=0;for(;a<t.length;){const h=t[a];if(A.has(h)){c=!0,l=h,i+=h,o=C([...t],a).isInsideLinkEscape,a+=1;continue}if(c){l+=h,i+=h,o?h===b&&(c=o=!1):h===x&&(c=!1,u.processEscape(l)),a+=1;continue}const f=m(h),p=h===" ";if(f===0){i+=h,a+=1;continue}if(s+f>e&&(i&&r.push(i+u.getEndEscapesForAllActiveAttributes()),i=u.getStartEscapesForAllActiveAttributes(),s=m(i),p&&n)){for(;a<t.length&&t[a]===" ";)a+=1;continue}if(i+=h,s+=f,s===e&&a<t.length-1&&(r.push(i+u.getEndEscapesForAllActiveAttributes()),i=u.getStartEscapesForAllActiveAttributes(),s=m(i),a+1<t.length&&t[a+1]===" "&&n)){for(a+=1;a<t.length&&t[a]===" ";)a+=1;continue}a+=1}return i&&r.push(i+u.getEndEscapesForAllActiveAttributes()),n?r.map(h=>v(h)):r},"wrapWithBreakAtWidth"),te=E((t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const u=[];let i="",s=0;return V(r,{getWidth:m,onSegment:E((c,o)=>{const l=c.text??"";if(c.isEscapeSequence)i+=l;else{const a=l===" ";if(c.width===0)return i+=l,!0;if(s+c.width>e&&(i&&u.push(i),i=o.getStartEscapesForAllActiveAttributes(),s=0,a))return n||u.push(o.getStartEscapesForAllActiveAttributes()+l),!0;i+=l,s+=c.width}return!0},"onSegment")}),i&&u.push(i),n?u.map(c=>v(c)):u},"wrapCharByChar"),re=E((t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const u=r.split(I),i=[];let s="",c=0,o=0;for(;o<u.length;){const l=u[o],a=y.test(l),h=m(l);if(l.length===0){o+=1;continue}if(n&&a&&c===0){o+=1;continue}if(c+h>e&&c>0){n?i.push(v(s)):i.push(s),s="",c=0;continue}s+=l,c+=h,o+=1}return s&&(n?i.push(v(s)):i.push(s)),i},"wrapWithWordBoundaries"),ie=E((t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const u=r.split(I),i=[];let s="",c=0,o=0;for(;o<u.length;){const l=u[o],a=y.test(l),h=m(l);if(l.length===0){o+=1;continue}if(n&&a&&c===0){o+=1;continue}if(h>e){s&&i.push(R(n?v(s):s));const f=O(l,e,n);if(f.length>0){for(let p=0;p<f.length-1;p+=1)i.push(f[p]);s=f.at(-1),c=m(s)}else s="",c=0;o+=1;continue}if(c+h>e&&c>0&&(i.push(R(n?v(s):s)),s="",c=0,n&&a)){o+=1;continue}s+=l,c+=h,o+=1}return s&&i.push(R(n?v(s):s)),i},"wrapAndBreakWords"),B={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},ce=E((t,e={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:u=80,wrapMode:i=B.PRESERVE_WORDS}=e;if(r&&t.trim()==="")return"";let s=t.normalize("NFC").replaceAll(`\r
1
+ var H=Object.defineProperty;var d=(t,e)=>H(t,"name",{value:e,configurable:!0});import{O as A,P as R,Q as x,S as b,T as P,U as $,V as j,W as D,X as N}from"./packem_shared/constants-DmzZF6_u.js";import{getStringWidth as m}from"./get-string-width.js";var q=Object.defineProperty,G=d((t,e)=>q(t,"name",{value:e,configurable:!0}),"a");const K=/\x1B\[(\d+)m/;let T=class{static{d(this,"d")}static{G(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const n=K.exec(e);if(!n)return;const i=Number.parseInt(n[1],10);switch(i){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(i>=30&&i<=37||i>=90&&i<=97)this.activeForeground=e;else if(i>=40&&i<=47||i>=100&&i<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(i))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(i)){const u={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[i];u&&(this.activeFormatting=this.activeFormatting.filter(r=>!r.includes(u)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const n={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(i=>{const u=n[i];u&&e.push(u)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}};var L=Object.defineProperty,w=d((t,e)=>L(t,"name",{value:e,configurable:!0}),"o");const U=w((t,e)=>{if(!A.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,i=t.slice(e+1,e+1+R.length).join("")===R;return{isInsideEscape:n,isInsideLinkEscape:i}},"checkEscapeSequence"),V=w((t,e={})=>{const n=new T;let i="",u=!1,r="",s="",c=!1;const o=[...t];for(let l=0;l<o.length;l++){const a=o[l];if(a&&A.has(a)){if(i){const g=e.getWidth?.(i)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:i,width:g};if(c&&(S.isHyperlink=!0,S.hyperlinkUrl=s),e.onSegment?.(S,n)===!1)return;i=""}u=!0,r=a;const p=U(o,l),{isInsideLinkEscape:O}=p;if(O){let g=l+1;for(s="";g<o.length;){const _=o[g];if(_===b)break;s+=_,g+=1}s=s.slice(4);const S={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,n)===!1)return;l=g,c=!0,u=!1,r="";continue}if(l+1<o.length&&o[l+1]==="\\"&&c){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,n)===!1)return;c=!1,s="",l+=1,u=!1,r="";continue}}if(u){if(r!==a&&(r+=a),a===x){u=!1,n.processEscape(r);const p={isEscapeSequence:!0,isGrapheme:!1,text:r,width:0};if(e.onSegment?.(p,n)===!1)return;r=""}continue}i+=a;const h=e.getWidth?.(i)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:i,width:h};if(c&&(f.isHyperlink=!0,f.hyperlinkUrl=s),e.onSegment?.(f,n)===!1)return;i=""}if(i){const l=e.getWidth?.(i)??0,a={isEscapeSequence:!1,isGrapheme:!0,text:i,width:l};c&&(a.isHyperlink=!0,a.hyperlinkUrl=s),e.onSegment?.(a,n)}if(r){const l={isEscapeSequence:!0,isGrapheme:!1,text:r,width:0};e.onSegment?.(l,n)}},"processAnsiString");var M=Object.defineProperty,Z=d((t,e)=>M(t,"name",{value:e,configurable:!0}),"t$1");const W=Z(t=>`${A.values().next().value}${P}${String(t)}${x}`,"wrapAnsiCode");var z=Object.defineProperty,Q=d((t,e)=>z(t,"name",{value:e,configurable:!0}),"s");const F=Q(t=>`${A.values().next().value}${R}${t}${b}`,"wrapAnsiHyperlink");var X=Object.defineProperty,J=d((t,e)=>X(t,"name",{value:e,configurable:!0}),"l");const Y=J(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",n,i;const u=t.join(`
2
+ `),r=[...u];let s=0;for(const[c,o]of r.entries()){if(e+=o,A.has(o)){const a=$.exec(u.slice(s))?.groups??{};if(a.code!==void 0){const h=Number.parseFloat(a.code);n=h===D?void 0:h}else a.uri!==void 0&&(i=a.uri.length===0?void 0:a.uri)}const l=j.get(Number(n));r[c+1]===`
3
+ `?(i&&(e+=F("")),n&&l&&(e+=W(l))):o===`
4
+ `&&(n&&l&&(e+=W(n)),i&&(e+=F(i))),s+=o.length}return e},"preserveAnsi");var ee=Object.defineProperty,E=d((t,e)=>ee(t,"name",{value:e,configurable:!0}),"h");const C=/(?=\s)|(?<=\s)/,I=/^\s+$/,k=E(t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},"resetAnsiAtLineBreak"),v=E(t=>{const e=t.split(" ");let n=e.length;for(;n>0&&m(e[n-1])===0;)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},"stringVisibleTrimSpacesRight"),y=E((t,e,n)=>{if(t.length===0)return[""];if(e<=0)return[t];const i=[],u=new T;let r="",s=0,c=!1,o=!1,l="",a=0;for(;a<t.length;){const h=t[a];if(A.has(h)){c=!0,l=h,r+=h,o=t.startsWith(R,a+1),a+=1;continue}if(c){l+=h,r+=h,o?h===b&&(c=o=!1):h===x&&(c=!1,u.processEscape(l)),a+=1;continue}const f=m(h),p=h===" ";if(f===0){r+=h,a+=1;continue}if(s+f>e&&(r&&i.push(r+u.getEndEscapesForAllActiveAttributes()),r=u.getStartEscapesForAllActiveAttributes(),s=m(r),p&&n)){for(;a<t.length&&t[a]===" ";)a+=1;continue}if(r+=h,s+=f,s===e&&a<t.length-1&&(i.push(r+u.getEndEscapesForAllActiveAttributes()),r=u.getStartEscapesForAllActiveAttributes(),s=m(r),a+1<t.length&&t[a+1]===" "&&n)){for(a+=1;a<t.length&&t[a]===" ";)a+=1;continue}a+=1}return r&&i.push(r+u.getEndEscapesForAllActiveAttributes()),n?i.map(h=>v(h)):i},"wrapWithBreakAtWidth"),te=E((t,e,n)=>{if(t.length===0)return[];const i=n?t.trim():t;if(i.length===0)return[];const u=[];let r="",s=0;return V(i,{getWidth:m,onSegment:E((c,o)=>{const l=c.text??"";if(c.isEscapeSequence)r+=l;else{const a=l===" ";if(c.width===0)return r+=l,!0;if(s+c.width>e&&(r&&u.push(r),r=o.getStartEscapesForAllActiveAttributes(),s=0,a))return n||u.push(o.getStartEscapesForAllActiveAttributes()+l),!0;r+=l,s+=c.width}return!0},"onSegment")}),r&&u.push(r),n?u.map(c=>v(c)):u},"wrapCharByChar"),ie=E((t,e,n)=>{if(t.length===0)return[];const i=n?t.trim():t;if(i.length===0)return[];const u=i.split(C),r=[];let s="",c=0,o=0;for(;o<u.length;){const l=u[o],a=I.test(l),h=m(l);if(l.length===0){o+=1;continue}if(n&&a&&c===0){o+=1;continue}if(c+h>e&&c>0){n?r.push(v(s)):r.push(s),s="",c=0;continue}s+=l,c+=h,o+=1}return s&&(n?r.push(v(s)):r.push(s)),r},"wrapWithWordBoundaries"),re=E((t,e,n)=>{if(t.length===0)return[];const i=n?t.trim():t;if(i.length===0)return[];const u=i.split(C),r=[];let s="",c=0,o=0;for(;o<u.length;){const l=u[o],a=I.test(l),h=m(l);if(l.length===0){o+=1;continue}if(n&&a&&c===0){o+=1;continue}if(h>e){s&&r.push(k(n?v(s):s));const f=y(l,e,n);if(f.length>0){for(let p=0;p<f.length-1;p+=1)r.push(f[p]);s=f.at(-1),c=m(s)}else s="",c=0;o+=1;continue}if(c+h>e&&c>0&&(r.push(k(n?v(s):s)),s="",c=0,n&&a)){o+=1;continue}s+=l,c+=h,o+=1}return s&&r.push(k(n?v(s):s)),r},"wrapAndBreakWords"),B={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},oe=E((t,e={})=>{const{removeZeroWidthCharacters:n=!0,trim:i=!0,width:u=80,wrapMode:r=B.PRESERVE_WORDS}=e;if(i&&t.trim()==="")return"";let s=t.normalize("NFC").replaceAll(`\r
5
5
  `,`
6
- `);return n&&(s=s.replaceAll(q,"")),s.split(`
7
- `).map(c=>{if(r&&c.trim()==="")return"";let o;switch(i){case B.BREAK_AT_CHARACTERS:{o=te(c,u,r);break}case B.BREAK_WORDS:{o=ie(c,u,r);break}case B.STRICT_WIDTH:{o=O(c,u,r);break}default:o=re(c,u,r)}return Y(o)}).join(`
8
- `)},"wordWrap");export{B as WrapMode,ce as wordWrap};
6
+ `);return n&&(s=s.replaceAll(N,"")),s.split(`
7
+ `).map(c=>{if(i&&c.trim()==="")return"";let o;switch(r){case B.BREAK_AT_CHARACTERS:{o=te(c,u,i);break}case B.BREAK_WORDS:{o=re(c,u,i);break}case B.STRICT_WIDTH:{o=y(c,u,i);break}default:o=ie(c,u,i)}return Y(o)}).join(`
8
+ `)},"wordWrap");export{B as WrapMode,oe as wordWrap};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/string",
3
- "version": "3.0.0-alpha.14",
3
+ "version": "3.0.0-alpha.15",
4
4
  "description": "Functions for manipulating strings.",
5
5
  "keywords": [
6
6
  "align",
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var r=(h,e)=>i(h,"name",{value:e,configurable:!0});var c=Object.defineProperty,a=r((h,e)=>c(h,"name",{value:e,configurable:!0}),"c");class y{static{r(this,"s")}static{a(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(s=>s!==e);else if(this.cache.size>=this.capacity){const s=this.keyOrder.shift();s!==void 0&&this.cache.delete(s)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}}export{y as default};