UNPKG

@visulima/string

Version:

Functions for manipulating strings.

2 lines (1 loc) 2.57 kB
const R=String.raw,E=R`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,a=()=>new RegExp(R`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${E}(?:\u200D${E})*`,"gu"),n=new Set(["\x1B","›"]),e="\x07",_="[",r="m",u="]8;;",S=39,s=/[\u200B\uFEFF\u2060-\u2064]/g,I=new RegExp(`(?:\\${_}(?<code>\\d+)m|\\${u}(?<uri>.*)${e})`),i=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),t=/^[ \t]*(?:\r\n|\r|\n)/,N=/(?:\r\n|\r|\n)[ \t]*$/,g=/^(?:[\r\n]|$)/,c=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,T=/^[ \t]*[\r\n][ \t\r\n]*$/,L=/\r\n|\n|\r/g,w=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,x=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,B=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,O=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,A=a(),H=/[-_./\s]+/g,C=/(\u001B\[[0-9;]*[a-z])/i,G=new RegExp("\\p{Script=Arabic}","u"),M=new RegExp("\\p{Script=Bengali}","u"),D=new RegExp("\\p{Script=Cyrillic}","u"),K=new RegExp("\\p{Script=Devanagari}","u"),F=new RegExp("\\p{Script=Ethiopic}","u"),P=new RegExp("\\p{Script=Greek}","u"),m=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),l=new RegExp("\\p{Script=Gujarati}","u"),o=new RegExp("\\p{Script=Gurmukhi}","u"),W=new RegExp("\\p{Script=Hangul}","u"),d=new RegExp("\\p{Script=Hebrew}","u"),$=new RegExp("\\p{Script=Hiragana}","u"),U=new RegExp("\\p{Script=Han}","u"),y=new RegExp("\\p{Script=Kannada}","u"),Y=new RegExp("\\p{Script=Katakana}","u"),h=new RegExp("\\p{Script=Khmer}","u"),k=new RegExp("\\p{Script=Lao}","u"),b=new RegExp("\\p{Script=Latin}","u"),j=new RegExp("\\p{Script=Malayalam}","u"),J=new RegExp("\\p{Script=Myanmar}","u"),V=new RegExp("\\p{Script=Oriya}","u"),f=new RegExp("\\p{Script=Sinhala}","u"),z=new RegExp("\\p{Script=Tamil}","u"),Z=new RegExp("\\p{Script=Telugu}","u"),q=new RegExp("\\p{Script=Thai}","u"),v=new RegExp("\\p{Script=Tibetan}","u"),Q=/[\u02BB\u02BC\u0027]/u,X=p=>p.replace(A,"");export{l as A,o as B,y as C,z as D,Z as E,j as F,f as G,q as H,k as I,v as J,J as K,F as L,h as M,V as N,n as O,r as P,u as Q,w as R,e as S,_ as T,I as U,i as V,S as W,s as X,O as a,A as b,C as c,x as d,B as e,t as f,N as g,T as h,g as i,L as j,c as k,H as l,D as m,b as n,P as o,m as p,Q as q,Y as r,X as s,U as t,$ as u,W as v,d as w,G as x,K as y,M as z};