@visulima/string 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/LICENSE.md +81 -129
- package/README.md +3 -3
- package/dist/align-text.js +2 -2
- package/dist/case/camel-case.d.ts +2 -2
- package/dist/case/camel-case.js +1 -1
- package/dist/case/capital-case.d.ts +2 -2
- package/dist/case/capital-case.js +1 -1
- package/dist/case/constant-case.d.ts +2 -2
- package/dist/case/constant-case.js +1 -1
- package/dist/case/dot-case.d.ts +2 -2
- package/dist/case/dot-case.js +1 -1
- package/dist/case/flat-case.d.ts +2 -2
- package/dist/case/flat-case.js +1 -1
- package/dist/case/flip-case.d.ts +2 -2
- package/dist/case/flip-case.js +1 -1
- package/dist/case/identify-case.d.ts +2 -2
- package/dist/case/identify-case.js +1 -1
- package/dist/case/index.d.ts +2 -2
- package/dist/case/index.js +1 -1
- package/dist/case/kebab-case.d.ts +2 -2
- package/dist/case/kebab-case.js +1 -1
- package/dist/case/lower-first.d.ts +2 -2
- package/dist/case/lower-first.js +1 -1
- package/dist/case/no-case.d.ts +2 -2
- package/dist/case/no-case.js +1 -1
- package/dist/case/pascal-case.d.ts +2 -2
- package/dist/case/pascal-case.js +1 -1
- package/dist/case/pascal-snake-case.d.ts +2 -2
- package/dist/case/pascal-snake-case.js +1 -1
- package/dist/case/path-case.d.ts +2 -2
- package/dist/case/path-case.js +1 -1
- package/dist/case/sentence-case.d.ts +2 -2
- package/dist/case/sentence-case.js +1 -1
- package/dist/case/snake-case.d.ts +2 -2
- package/dist/case/snake-case.js +1 -1
- package/dist/case/split-by-case.d.ts +2 -2
- package/dist/case/split-by-case.js +1 -1
- package/dist/case/title-case.d.ts +2 -2
- package/dist/case/title-case.js +1 -1
- package/dist/case/train-case.d.ts +2 -2
- package/dist/case/train-case.js +1 -1
- package/dist/case/upper-first.d.ts +2 -2
- package/dist/case/upper-first.js +1 -1
- package/dist/closest-string.js +1 -1
- package/dist/compare-similarity.js +1 -1
- package/dist/count-occurrences.js +1 -1
- package/dist/direction.js +1 -1
- package/dist/east-asian-width.d.ts +5 -1
- package/dist/east-asian-width.js +1 -1
- package/dist/excerpt.js +55 -44
- package/dist/get-string-truncated-width.js +1 -1
- package/dist/indent.d.ts +3 -1
- package/dist/indent.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/is-fullwidth-code-point.js +1 -1
- package/dist/levenshtein.js +1 -1
- package/dist/native-string-types.d.ts +6 -1
- package/dist/outdent.js +1 -1
- package/dist/packem_shared/{_isFullWidth-Dqc3MWgl.js → _isFullWidth-dWWDw5Is.js} +1 -1
- package/dist/packem_shared/ansi-state-tracker-BFhXTS-5.js +1 -0
- package/dist/packem_shared/closest-CSX4px2F.js +1 -0
- package/dist/packem_shared/constants-BGGeBKGT.js +1 -0
- package/dist/packem_shared/dedent-CDXp3nZQ.js +1 -0
- package/dist/packem_shared/eastAsianWidth-DACe9Ds2.js +1 -0
- package/dist/packem_shared/generate-cache-key-th9N8-CB.js +1 -0
- package/dist/packem_shared/indent-CY079Qyq.js +1 -0
- package/dist/packem_shared/joinSegments-9qx7xSy7.js +1 -0
- package/dist/packem_shared/{lru-cache-BtMSrYQJ.js → lru-cache-BD25OaEQ.js} +1 -1
- package/dist/packem_shared/normalize-german-eszett-DtW4F-Wg.js +1 -0
- package/dist/packem_shared/redent-lctoaAtw.js +1 -0
- package/dist/packem_shared/{strip-vt-control-characters-BW1RglLp.js → strip-vt-control-characters-vMeu7uFw.js} +1 -1
- package/dist/packem_shared/{types.d-CMNqA5bi.d.ts → types.d-BdJ2aEyS.d.ts} +1 -1
- package/dist/packem_shared/{types.d-LgsTR37y.d.ts → types.d-Bky9TnxG.d.ts} +6 -1
- package/dist/replace-string.d.ts +1 -1
- package/dist/replace-string.js +1 -1
- package/dist/slice.js +1 -1
- package/dist/slugify.d.ts +1 -1
- package/dist/slugify.js +1 -1
- package/dist/test/utils.js +10 -10
- package/dist/transliterate.d.ts +1 -1
- package/dist/transliterate.js +3 -3
- package/dist/truncate.js +1 -1
- package/dist/utilities.d.ts +1 -1
- package/dist/utilities.js +1 -1
- package/dist/word-similarity-sort.js +1 -1
- package/dist/word-wrap.js +5 -7
- package/package.json +2 -2
- package/dist/packem_shared/closest-C6YDQs4m.js +0 -1
- package/dist/packem_shared/constants-aPzGW29R.js +0 -1
- package/dist/packem_shared/dedent-CPjAYUXh.js +0 -1
- package/dist/packem_shared/eastAsianWidth-DJV8Kqd-.js +0 -1
- package/dist/packem_shared/generate-cache-key-B_0X7MKm.js +0 -1
- package/dist/packem_shared/indent-cz8WMI0e.js +0 -1
- package/dist/packem_shared/joinSegments-CaHT-45s.js +0 -1
- package/dist/packem_shared/normalize-german-eszett-hNMwtGjd.js +0 -1
- package/dist/packem_shared/redent-ByOoJ6fN.js +0 -1
package/dist/case/path-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as o}from"../packem_shared/lru-cache-BD25OaEQ.js";import{kebabCase as t}from"./kebab-case.js";const r=new o(1e3),f=(e,a)=>t(e,{cacheStore:r,...a,joiner:"/"});export{f as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CaseOptions, S as SentenceCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, S as SentenceCase } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/**
|
|
4
4
|
* Converts a string to Sentence case.
|
|
5
5
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"../packem_shared/constants-
|
|
1
|
+
import{c as o}from"../packem_shared/constants-BGGeBKGT.js";import{L as f}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as h}from"./split-by-case.js";import d from"./upper-first.js";import{g as u}from"../packem_shared/generate-cache-key-th9N8-CB.js";import A from"../packem_shared/joinSegments-9qx7xSy7.js";import{n as C}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const y=new f(1e3),w=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,c=e?.cacheStore??y;let r;if(s&&(r=u(t,e)),s&&r&&c.has(r))return c.get(r);let l=!0;const n=A(h(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(a=>{if(e?.handleAnsi&&o.test(a))return a;const m=e?.locale?.startsWith("de")?C(a):a,i=e?.locale?m.toLocaleLowerCase(e.locale):m.toLowerCase();return l?(l=!1,d(i,e)):i})," ");return s&&r&&c.set(r,n),n};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CaseOptions, h as SnakeCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, h as SnakeCase } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/**
|
|
4
4
|
* Converts a string to snake_case.
|
|
5
5
|
* @example
|
package/dist/case/snake-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as o}from"../packem_shared/lru-cache-BD25OaEQ.js";import{kebabCase as t}from"./kebab-case.js";const r=new o(1e3),n=(e,a)=>t(e,{cacheStore:r,...a,joiner:"_"});export{n as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocaleOptions, i as SplitByCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { L as LocaleOptions, i as SplitByCase } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/** Options for the `splitByCase` function. */
|
|
4
4
|
interface SplitOptions extends LocaleOptions {
|
|
5
5
|
/** Whether to handle ANSI escape sequences. (default: false) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{R as x,s as V,c as S,l as w,m as R,n as W,o as M,p as P,q as F,r as O,t as Y,u as B,v as D,w as G,x as q,y as $,z as Z,A as Q,B as X,C as tt,D as et,E as st,F as nt,G as rt,H as it,I as at,J as ot,K as pt,L as lt,M as ht,N as ct}from"../packem_shared/constants-BGGeBKGT.js";import{L as ft}from"../packem_shared/lru-cache-BD25OaEQ.js";import{s as ut}from"../packem_shared/strip-vt-control-characters-vMeu7uFw.js";const b=new ft(1e3),gt=/[.*+?^${}()|[\]\\]/g,dt=t=>{const i=t.join("");if(b.has(i)){const C=b.get(i);return C.lastIndex=0,C}const h=t.map(C=>C.replaceAll(gt,String.raw`\$&`)).join("|"),g=new RegExp(h,"g");return b.set(i,g),g},Ct=t=>{const i=[];let h=0,g;for(x.lastIndex=0;(g=x.exec(t))!==null;)g.index>h&&i.push(t.slice(h,g.index)),i.push(g[0]),h=x.lastIndex;return h<t.length&&i.push(t.slice(h)),i.filter(Boolean)},Et=/[ČŠŽĐ]/i,y=new Uint8Array(128),H=new Uint8Array(128),T=new Uint8Array(128);for(let t=0;t<128;t++)y[t]=t>=65&&t<=90?1:0,H[t]=t>=97&&t<=122?1:0,T[t]=t>=48&&t<=57?1:0;const k=t=>y[t],K=t=>H[t],N=t=>T[t],_=(t,i,h,g,C)=>{if(t.length===0)return[];let f=!1;const U=Object.values(i);for(const s of U)if(s(t[0])){f=!0;break}if(!f&&!h)return[t];const u=[...t],A=[];let e=u[0],a="other";const l=Object.entries(i);for(const s of l){const[r,p]=s;if(p(u[0])){a=r;break}}let n=h&&g?u[0]===u[0].toLocaleUpperCase(g):!1;for(let s=1;s<u.length;s++){const r=u[s];let p="other";for(const d of l){const[E,I]=d;if(I(r)){p=E;break}}const c=h&&g?r===r.toLocaleUpperCase(g):!1;let o=!1;C?o=C(a,p,n,c,r,s,u):(a!==p&&a!=="other"&&p!=="other"&&(o=!0),h&&p!=="other"&&!n&&c&&(o=!0)),o?(A.push(e),e=r):e+=r,a=p,h&&(n=c)}return e&&e.length>0&&A.push(e),A.length>0?A:[t]},At=(t,i,h,g)=>{if(h.size===0)return i;for(const C of h)if(t.startsWith(C,i))return g.push(C),i+C.length;return i},z=(t,i=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let h=0;const g=[],C=t.length;for(let f=1;f<C;f++){const U=At(t,h,i,g);if(U!==h){h=U,f=h-1;continue}const u=t.codePointAt(f-1),A=t.codePointAt(f),e=u&&u<128&&k(u),a=A&&A<128&&k(A),l=u&&u<128&&K(u),n=u&&u<128&&N(u),s=A&&A<128&&N(A);if(l&&a){g.push(t.slice(h,f)),h=f;continue}if(n&&!s||!n&&s){g.push(t.slice(h,f)),h=f;continue}if(s&&!n){let r=!1,p=!1;if(f+1<C){const c=t.codePointAt(f+1);r=c&&c<128&&k(c),p=c&&c<128&&N(c)}if(!p&&r){g.push(t.slice(h,f),t.slice(f,f+1)),h=f+1;continue}}if(f+1<C){const r=t.codePointAt(f+1),p=r&&r<128&&K(r);if(e&&a&&p){const c=t.slice(h,f+1);i.has(c)||(g.push(t.slice(h,f)),h=f)}}}return h<C&&g.push(t.slice(h)),g.filter(f=>f!=="")},v=(t,i,h)=>{if(t.length===0)return[];const g=t===t.toLocaleUpperCase(i);if(i.startsWith("de")){if(!g&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(i))return[t];const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i),r=s,p=s?0:-1;for(let c=1;c<a;c++){const o=e[c],d=o===o.toLocaleUpperCase(i);if(d===s)n+=o;else if(d)n&&n.length>0&&(l.push(n),n=o),r=!0,p=c;else{if(r&&c-p>1){const E=e[c-1],I=n.slice(0,-1);I&&I.length>0&&l.push(I),n=E+o}else n+=o;r=!1,p=-1}s=d}return n&&n.length>0&&l.push(n),l}if(i.startsWith("uk")||i.startsWith("ru")||i.startsWith("bg")||i.startsWith("sr")||i.startsWith("mk")||i.startsWith("be")){if(!w.test(t)&&!R.test(t))return[t];const e=[...t],a=e.length,l=[];let n=e[0];const s=e[0];let r;w.test(s)?r=1:R.test(s)?r=2:r=0;let p=s===s.toLocaleUpperCase(i);for(let o=1;o<a;o++){const d=e[o];let E;w.test(d)?E=1:R.test(d)?E=2:E=0;const I=d===d.toLocaleUpperCase(i);r!==E&&(r===1||r===2)&&(E===1||E===2)||E===r&&!p&&I?(l.push(n),n=d):n+=d,r=E,p=I}n&&n.length>0&&l.push(n);const c=[];for(let o=0;o<l.length;o++)o<l.length-1&&l[o].length===1&&R.test(l[o])&&w.test(l[o+1][0])?(c.push(l[o]+l[o+1]),o+=1):c.push(l[o]);return c}if(i.startsWith("el")){if(!W.test(t)&&!R.test(t))return[t];const e=[];M.lastIndex=0;let a;for(;(a=M.exec(t))!==null;)e.push(a[0]);e.length===0&&e.push(t);const l=[];if(e.length===1){const s=e[0];if(!s||!W.test(s[0])||s.length===1)return[s??t]}for(const s of e){if(!s)continue;if(!W.test(s[0])||s.length===1){l.push(s);continue}const r=s.length;let p=s[0],c=s[0]===s[0].toLocaleUpperCase(i);for(let o=1;o<r;o++){const d=s[o],E=d===d.toLocaleUpperCase(i);!c&&E?(l.push(p),p=d):p+=d,c=E}p&&l.push(p)}return l}if(i.startsWith("ja")||i.startsWith("ko")){const e=i.startsWith("ja"),a=e?{hiragana:n=>Y.test(n),kanji:n=>O.test(n),katakana:n=>F.test(n),latin:n=>R.test(n)}:{hangul:n=>B.test(n),latin:n=>R.test(n)},l=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(e){const n=_(t,a,!1,i,(r,p)=>r==="hiragana"&&p==="katakana"||r==="katakana"&&p==="hiragana"||r==="hiragana"&&p==="latin"||r==="katakana"&&p==="latin"||r==="kanji"&&p==="latin"||r==="latin"&&(p==="hiragana"||p==="katakana"||p==="kanji")),s=[];for(const r of n){const p=r;p.length===1&&l.has(p)&&s.length>0?s[s.length-1]=s.at(-1)+p:s.push(p)}return s.length>0?s:[t]}return _(t,a,!1,i,(n,s)=>n==="hangul"&&s==="latin"||n==="latin"&&s==="hangul")}if(i.startsWith("sl")){const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i);for(let r=1;r<a;r++){const p=e[r],c=p===p.toLocaleUpperCase(i),o=Et.test(p),d=r<a-1&&e[r+1]===e[r+1].toLocaleUpperCase(i);!s&&c||o&&d?(l.push(n),n=p,o&&d&&(l.push(n),n="")):n+=p,s=c}return n&&n.length>0&&l.push(n),l}if(i.startsWith("zh"))return _(t,{han:e=>O.test(e),latin:e=>R.test(e)},!1,i);if(["ar","fa","he","ur"].includes(i.split("-")[0])){const e=a=>D.test(a)||G.test(a);return _(t,{latin:a=>R.test(a),rtl:a=>e(a)},!1,i)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(i.split("-")[0])){const e=a=>$.test(a)||Z.test(a)||Q.test(a)||X.test(a)||tt.test(a)||et.test(a)||st.test(a)||nt.test(a)||rt.test(a)||it.test(a)||at.test(a)||ot.test(a)||pt.test(a)||lt.test(a)||ht.test(a)||ct.test(a);return _(t,{indic:a=>e(a),latin:a=>R.test(a)},!1,i)}if(["be","bg","ru","sr","uk"].includes(i))return _(t,{cyrillic:e=>w.test(e),latin:e=>R.test(e)},!0,i);if(["ar","fa","he"].includes(i))return _(t,{latin:e=>R.test(e),rtl:e=>D.test(e)||G.test(e)},!1,i);if(i.startsWith("ko"))return _(t,{hangul:e=>B.test(e),latin:e=>R.test(e)},!1,i);if(i.startsWith("uz")){if(!w.test(t)&&!R.test(t))return[t];const e=[...t],a=e.length,l=[];let n=e[0],s=e[0]===e[0].toLocaleUpperCase(i);for(let r=1;r<a;r++){const p=e[r],c=p===p.toLocaleUpperCase(i);if(P.test(p)||P.test(e[r-1])){n+=p;continue}!s&&c?(l.push(n),n=p):n+=p,s=c}return n&&n.length>0&&l.push(n),l}const C=[...t],f=C.length,U=[];let u=C[0],A=C[0]===C[0].toLocaleUpperCase(i);for(const e of h)if(t.startsWith(e)){U.push(e),u=C[e.length],A=u===u.toLocaleUpperCase(i);break}for(let e=1;e<f;e++){const a=C[e],l=a===a.toLocaleUpperCase(i);let n=0;for(const s of h)if(t.startsWith(s,e)){U.push(u,s),n=s.length,u="";const r=s.at(-1);r&&(A=r===r.toLocaleUpperCase(i));break}if(n>0){e+=n-1;continue}!A&&l?(U.push(u),u=a):u+=a,A=l}return u&&U.push(u),U},Ut=(t,i,h)=>{const g=[],C=S.test(t)?t.split(S).filter(Boolean):[t];for(const f of C){const U=f;if(S.test(U))g.push(U);else{x.lastIndex=0;const u=x.test(U)?Ct(U).filter(Boolean):[U];for(const A of u)if(x.lastIndex=0,x.test(A))g.push(A);else if(i){const e=i.toLowerCase().split("-")[0];g.push(...v(A,e,h))}else g.push(...z(A,h))}}return g},mt=(t,i={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:h=!1,handleEmoji:g=!1,knownAcronyms:C=[],locale:f,normalize:U=!1,separators:u,stripAnsi:A=!1,stripEmoji:e=!1}=i,a=new Set([...C].toSorted((o,d)=>d.length-o.length));let l=t;A&&(l=ut(l)),e&&(l=V(l));let n;Array.isArray(u)?n=dt(u):u instanceof RegExp?n=u:n=q;const s=[];let r=l;const p=n.flags.includes("g")?n:new RegExp(n.source,`${n.flags}g`);for(;r.length>0;){const o=p.exec(r);if(!o){r===".."?s.push(".."):r==="."?s.push("."):r.length>0&&s.push(r);break}const d=o.index,E=o[0],I=E.length,j=r.slice(0,d),J=r.slice(d+I);if(E.startsWith("../"))s.push(".."),r=r.slice(d+3);else if(E.startsWith("./"))s.push("."),r=r.slice(d+2);else if(d===0&&E==="..")s.push(".."),r=r.slice(2);else if(d===0&&E===".")s.push("."),r=r.slice(1);else{j.length>0&&s.push(j);let L=0;for(;(L=E.indexOf("../",L))!==-1;)s.push(".."),L+=3;for(L=0;(L=E.indexOf("./",L))!==-1;)(L===0||E[L-1]!==".")&&s.push("."),L+=2;let m=J;for(;m.startsWith("../");)s.push(".."),m=m.slice(3);for(;m.startsWith("./");)s.push("."),m=m.slice(2);if(m===".."){s.push("..");break}else if(m==="."){s.push(".");break}else r=m}p.lastIndex=0}if(s.length===0){const o=l.split(n).filter(Boolean);s.push(...o)}let c=[];for(const o of s)h||g?c.push(...Ut(o,f,a)):f?c.push(...v(o,f,a)):c.push(...z(o,a));return U&&(c=c.map(o=>a.has(o)?o:f&&o===o.toLocaleUpperCase(f)?o[0]+o.slice(1).toLocaleLowerCase(f):o.toUpperCase()===o&&!a.has(o)?o.slice(0,1)+o.slice(1).toLowerCase():o)),c};export{mt as splitByCase};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CaseOptions, T as TitleCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, T as TitleCase } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/**
|
|
4
4
|
* With Title Case all words are capitalized, except for minor words.
|
|
5
5
|
* @example
|
package/dist/case/title-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as n}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as o}from"./split-by-case.js";import i from"./upper-first.js";import{g as h}from"../packem_shared/generate-cache-key-th9N8-CB.js";import{n as f}from"../packem_shared/normalize-german-eszett-DtW4F-Wg.js";const d=new n(1e3);function z(a,e){if(typeof a!="string")return"";const t=e?.cache??!1,l=e?.cacheStore??d;let r;if(t&&(r=h(a,e)),t&&r&&l.has(r))return l.get(r);const c=o(a,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(s=>{const m=e?.locale?.startsWith("de")?f(s):s;return i(e?.locale?m.toLocaleLowerCase(e.locale):m.toLowerCase(),{locale:e?.locale})}).join(" ");return t&&r&&l.set(r,c),c}export{z as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CaseOptions, j as TrainCase } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { b as CaseOptions, j as TrainCase } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/**
|
|
4
4
|
* Converts a string to Train-Case.
|
|
5
5
|
* @example
|
package/dist/case/train-case.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as n}from"../packem_shared/lru-cache-BD25OaEQ.js";import{splitByCase as i}from"./split-by-case.js";import l from"./upper-first.js";import{g as o}from"../packem_shared/generate-cache-key-th9N8-CB.js";import h from"../packem_shared/joinSegments-9qx7xSy7.js";const f=new n(1e3),C=(a,e)=>{if(typeof a!="string")return"";const t=e?.cache??!1,c=e?.cacheStore??f;let r;if(t&&(r=o(a,e)),t&&r&&c.has(r))return c.get(r);const s=h(i(a,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(m=>l(m,{locale:e?.locale})),"-");return t&&r&&c.set(r,s),s};export{C as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocaleOptions, U as UpperFirst } from "../packem_shared/types.d-
|
|
2
|
-
import "../packem_shared/types.d-
|
|
1
|
+
import { L as LocaleOptions, U as UpperFirst } from "../packem_shared/types.d-BdJ2aEyS.js";
|
|
2
|
+
import "../packem_shared/types.d-Bky9TnxG.js";
|
|
3
3
|
/**
|
|
4
4
|
* Converts first character to upper case.
|
|
5
5
|
* @param value The string to convert.
|
package/dist/case/upper-first.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s=(r,t)=>typeof r!="string"||r===""?"":(t?.locale?r[0].toLocaleUpperCase(t.locale):r[0].toUpperCase())+r.slice(1);export{s as default};
|
package/dist/closest-string.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distance as
|
|
1
|
+
import{distance as f}from"./packem_shared/closest-CSX4px2F.js";const h=(o,t,l)=>{if(t.length===0)throw new TypeError("When using closestString(), the possibleWords array must contain at least one word");const{caseSensitive:n,compareFn:r=f}={...l},s=n?o:o.toLowerCase();let c=t[0]??void 0,i=1/0;for(const d of t){const e=d,a=n?r(s,e):r(s,e.toLowerCase());a<i&&(c=e,i=a)}return c};export{h as closestString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distance as
|
|
1
|
+
import{distance as n}from"./packem_shared/closest-CSX4px2F.js";const s=(o,a)=>{const{compareFn:e=n}={...a};if(a?.caseSensitive)return(r,t)=>e(o,r)-e(o,t);const c=o.toLowerCase();return(r,t)=>e(c,r.toLowerCase())-e(c,t.toLowerCase())};export{s as compareSimilarity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const x=(o,e)=>{const n=String(o);if(typeof e!="string")throw new TypeError("Expected character");if(e.length===0)throw new TypeError("Expected non-empty substring");let r=0,t=n.indexOf(e);for(;t!==-1;){r++;const c=t+e.length;if(c<=t)break;t=n.indexOf(e,c)}return r};export{x as countOccurrences};
|
package/dist/direction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r="֑-߿יִ-﷽ﹰ-ﻼ",e="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",o=new RegExp(`^[^${e}]*[${r}]`),s=new RegExp(`^[^${r}]*[${e}]`),c=(n="")=>{const t=n;return o.test(t)?"rtl":s.test(t)?"ltr":"neutral"};export{c as direction};
|
|
@@ -55,4 +55,8 @@ console.log(eastAsianWidthType(codePoint));
|
|
|
55
55
|
```
|
|
56
56
|
*/
|
|
57
57
|
declare function eastAsianWidthType(codePoint: number): WidthType;
|
|
58
|
-
export {
|
|
58
|
+
export {
|
|
59
|
+
|
|
60
|
+
type Options as EastAsianWidthOptions,
|
|
61
|
+
|
|
62
|
+
type WidthType as EastAsianWidthType, eastAsianWidth, eastAsianWidthType };
|
package/dist/east-asian-width.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eastAsianWidth as e,eastAsianWidthType as i}from"./packem_shared/eastAsianWidth-
|
|
1
|
+
import{eastAsianWidth as e,eastAsianWidthType as i}from"./packem_shared/eastAsianWidth-DACe9Ds2.js";export{e as eastAsianWidth,i as eastAsianWidthType};
|