Socket
Socket
Sign inDemoInstall

@akcybex/jstr

Package Overview
Dependencies
205
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.16 to 1.0.17

4

dist/jstr.umd.js

@@ -1,4 +0,4 @@

(function(m,w){typeof exports=="object"&&typeof module<"u"?module.exports=w():typeof define=="function"&&define.amd?define(w):(m=typeof globalThis<"u"?globalThis:m||self,m.JStr=w())})(this,function(){"use strict";var Y=Object.defineProperty;var V=(m,w,E)=>w in m?Y(m,w,{enumerable:!0,configurable:!0,writable:!0,value:E}):m[w]=E;var M=(m,w,E)=>(V(m,typeof w!="symbol"?w+"":w,E),E);let m;const w=new Uint8Array(16);function E(){if(!m&&(m=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!m))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m(w)}const O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function k(l){return typeof l=="string"&&O.test(l)}const g=[];for(let l=0;l<256;++l)g.push((l+256).toString(16).slice(1));function z(l,e=0){return g[l[e+0]]+g[l[e+1]]+g[l[e+2]]+g[l[e+3]]+"-"+g[l[e+4]]+g[l[e+5]]+"-"+g[l[e+6]]+g[l[e+7]]+"-"+g[l[e+8]]+g[l[e+9]]+"-"+g[l[e+10]]+g[l[e+11]]+g[l[e+12]]+g[l[e+13]]+g[l[e+14]]+g[l[e+15]]}const b={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function P(l,e,t){if(b.randomUUID&&!e&&!l)return b.randomUUID();l=l||{};const r=l.random||(l.rng||E)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=r[s];return e}return z(r)}var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function q(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function W(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I={exports:{}};(function(l,e){(function(t,r){typeof W=="function"?l.exports=r():t.pluralize=r()})(D,function(){var t=[],r=[],s={},a={},o={};function h(u){return typeof u=="string"?new RegExp("^"+u+"$","i"):u}function f(u,c){return u===c?c:u===u.toLowerCase()?c.toLowerCase():u===u.toUpperCase()?c.toUpperCase():u[0]===u[0].toUpperCase()?c.charAt(0).toUpperCase()+c.substr(1).toLowerCase():c.toLowerCase()}function p(u,c){return u.replace(/\$(\d{1,2})/g,function(x,$){return c[$]||""})}function R(u,c){return u.replace(c[0],function(x,$){var v=p(c[1],arguments);return f(x===""?u[$-1]:x,v)})}function A(u,c,x){if(!u.length||s.hasOwnProperty(u))return c;for(var $=x.length;$--;){var v=x[$];if(v[0].test(c))return R(c,v)}return c}function U(u,c,x){return function($){var v=$.toLowerCase();return c.hasOwnProperty(v)?f($,v):u.hasOwnProperty(v)?f($,u[v]):A(v,$,x)}}function C(u,c,x,$){return function(v){var L=v.toLowerCase();return c.hasOwnProperty(L)?!0:u.hasOwnProperty(L)?!1:A(L,L,x)===L}}function d(u,c,x){var $=c===1?d.singular(u):d.plural(u);return(x?c+" ":"")+$}return d.plural=U(o,a,t),d.isPlural=C(o,a,t),d.singular=U(a,o,r),d.isSingular=C(a,o,r),d.addPluralRule=function(u,c){t.push([h(u),c])},d.addSingularRule=function(u,c){r.push([h(u),c])},d.addUncountableRule=function(u){if(typeof u=="string"){s[u.toLowerCase()]=!0;return}d.addPluralRule(u,"$0"),d.addSingularRule(u,"$0")},d.addIrregularRule=function(u,c){c=c.toLowerCase(),u=u.toLowerCase(),o[u]=c,a[c]=u},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(u){return d.addIrregularRule(u[0],u[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(u){return d.addPluralRule(u[0],u[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(u){return d.addSingularRule(u[0],u[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d})})(I);var T=I.exports;const F=q(T);class i{constructor(e){M(this,"value");Array.isArray(e)&&(e=e.join(" ")),this.value=e}after(e){return new i(n.after(this.value,e))}afterLast(e){return new i(n.afterLast(this.value,e))}ascii(){return new i(n.ascii(this.value))}before(e){return new i(n.before(this.value,e))}beforeLast(e){return new i(n.beforeLast(this.value,e))}between(e,t){return new i(n.between(this.value,e,t))}betweenFirst(e,t){return new i(n.betweenFirst(this.value,e,t))}camel(){return new i(n.camel(this.value))}charAt(e){return new i(n.charAt(this.value,e))}contains(e,t=!1){return n.contains(this.value,e,t)}containsAll(e,t=!1){return n.containsAll(this.value,e,t)}endsWith(e){return n.endsWith(this.value,e)}excerpt(e="",t={}){return n.excerpt(this.value,e,t)}finish(e){return n.finish(this.value,e)}wrap(e,t=null){return new i(n.wrap(this.value,e,t))}headline(){return new i(n.headline(this.value))}capitalize(){return new i(n.capitalize(this.value))}is(e){return n.is(e,this.value)}isAscii(){return n.isAscii(this.value)}isEmpty(){return this.value===""}isNotEmpty(){return!this.isEmpty()}isJson(){return n.isJson(this.value)}isUuid(){return n.isUuid(this.value)}isUlid(){return n.isUlid(this.value)}isUrl(){return n.isUrl(this.value)}kebab(){return new i(n.kebab(this.value))}snake(e="_"){return new i(n.snake(this.value,e))}lcfirst(){return new i(n.lcfirst(this.value))}ucfirst(){return new i(n.ucfirst(this.value))}ucsplit(){return n.ucsplit(this.value)}length(e){return n.length(this.value,e)}limit(e=100,t="..."){return new i(n.limit(this.value,e,t))}lower(){return new i(n.lower(this.value))}upper(){return new i(n.upper(this.value))}ltrim(e=" "){return new i(n.ltrim(this.value,e))}trim(e=""){return new i(n.trim(this.value,e))}rtrim(e=" "){return new i(n.rtrim(this.value,e))}mask(e,t,r=null,s="UTF-8"){return new i(n.mask(this.value,e,t,r,s))}match(e){return new i(n.match(e,this.value))}isMatch(e){return n.isMatch(e,this.value)}matchAll(e){return n.matchAll(e,this.value)}newLine(e=1){return this.append(`
(function(m,w){typeof exports=="object"&&typeof module<"u"?module.exports=w():typeof define=="function"&&define.amd?define(w):(m=typeof globalThis<"u"?globalThis:m||self,m.JStr=w())})(this,function(){"use strict";var Y=Object.defineProperty;var V=(m,w,E)=>w in m?Y(m,w,{enumerable:!0,configurable:!0,writable:!0,value:E}):m[w]=E;var M=(m,w,E)=>(V(m,typeof w!="symbol"?w+"":w,E),E);let m;const w=new Uint8Array(16);function E(){if(!m&&(m=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!m))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m(w)}const O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function k(l){return typeof l=="string"&&O.test(l)}const g=[];for(let l=0;l<256;++l)g.push((l+256).toString(16).slice(1));function z(l,e=0){return g[l[e+0]]+g[l[e+1]]+g[l[e+2]]+g[l[e+3]]+"-"+g[l[e+4]]+g[l[e+5]]+"-"+g[l[e+6]]+g[l[e+7]]+"-"+g[l[e+8]]+g[l[e+9]]+"-"+g[l[e+10]]+g[l[e+11]]+g[l[e+12]]+g[l[e+13]]+g[l[e+14]]+g[l[e+15]]}const b={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function P(l,e,t){if(b.randomUUID&&!e&&!l)return b.randomUUID();l=l||{};const r=l.random||(l.rng||E)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=r[s];return e}return z(r)}var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function q(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function W(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I={exports:{}};(function(l,e){(function(t,r){typeof W=="function"?l.exports=r():t.pluralize=r()})(D,function(){var t=[],r=[],s={},a={},o={};function h(u){return typeof u=="string"?new RegExp("^"+u+"$","i"):u}function p(u,c){return u===c?c:u===u.toLowerCase()?c.toLowerCase():u===u.toUpperCase()?c.toUpperCase():u[0]===u[0].toUpperCase()?c.charAt(0).toUpperCase()+c.substr(1).toLowerCase():c.toLowerCase()}function f(u,c){return u.replace(/\$(\d{1,2})/g,function(x,$){return c[$]||""})}function R(u,c){return u.replace(c[0],function(x,$){var v=f(c[1],arguments);return p(x===""?u[$-1]:x,v)})}function A(u,c,x){if(!u.length||s.hasOwnProperty(u))return c;for(var $=x.length;$--;){var v=x[$];if(v[0].test(c))return R(c,v)}return c}function U(u,c,x){return function($){var v=$.toLowerCase();return c.hasOwnProperty(v)?p($,v):u.hasOwnProperty(v)?p($,u[v]):A(v,$,x)}}function C(u,c,x,$){return function(v){var L=v.toLowerCase();return c.hasOwnProperty(L)?!0:u.hasOwnProperty(L)?!1:A(L,L,x)===L}}function d(u,c,x){var $=c===1?d.singular(u):d.plural(u);return(x?c+" ":"")+$}return d.plural=U(o,a,t),d.isPlural=C(o,a,t),d.singular=U(a,o,r),d.isSingular=C(a,o,r),d.addPluralRule=function(u,c){t.push([h(u),c])},d.addSingularRule=function(u,c){r.push([h(u),c])},d.addUncountableRule=function(u){if(typeof u=="string"){s[u.toLowerCase()]=!0;return}d.addPluralRule(u,"$0"),d.addSingularRule(u,"$0")},d.addIrregularRule=function(u,c){c=c.toLowerCase(),u=u.toLowerCase(),o[u]=c,a[c]=u},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(u){return d.addIrregularRule(u[0],u[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(u){return d.addPluralRule(u[0],u[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(u){return d.addSingularRule(u[0],u[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d})})(I);var T=I.exports;const F=q(T);class i{constructor(e){M(this,"value");Array.isArray(e)&&(e=e.join(" ")),this.value=e}after(e){return new i(n.after(this.value,e))}afterLast(e){return new i(n.afterLast(this.value,e))}ascii(){return new i(n.ascii(this.value))}before(e){return new i(n.before(this.value,e))}beforeLast(e){return new i(n.beforeLast(this.value,e))}between(e,t){return new i(n.between(this.value,e,t))}betweenFirst(e,t){return new i(n.betweenFirst(this.value,e,t))}camel(){return new i(n.camel(this.value))}charAt(e){return new i(n.charAt(this.value,e))}contains(e,t=!1){return n.contains(this.value,e,t)}containsAll(e,t=!1){return n.containsAll(this.value,e,t)}endsWith(e){return n.endsWith(this.value,e)}excerpt(e="",t={}){return n.excerpt(this.value,e,t)}finish(e){return n.finish(this.value,e)}wrap(e,t=null){return new i(n.wrap(this.value,e,t))}headline(){return new i(n.headline(this.value))}capitalize(){return new i(n.capitalize(this.value))}is(e){return n.is(e,this.value)}isAscii(){return n.isAscii(this.value)}isEmpty(){return this.value===""}isNotEmpty(){return!this.isEmpty()}isJson(){return n.isJson(this.value)}isUuid(){return n.isUuid(this.value)}isUlid(){return n.isUlid(this.value)}isUrl(){return n.isUrl(this.value)}kebab(){return new i(n.kebab(this.value))}snake(e="_"){return new i(n.snake(this.value,e))}lcfirst(){return new i(n.lcfirst(this.value))}ucfirst(){return new i(n.ucfirst(this.value))}ucsplit(){return n.ucsplit(this.value)}length(e){return n.length(this.value,e)}limit(e=100,t="..."){return new i(n.limit(this.value,e,t))}lower(){return new i(n.lower(this.value))}upper(){return new i(n.upper(this.value))}ltrim(e=" "){return new i(n.ltrim(this.value,e))}trim(e=""){return new i(n.trim(this.value,e))}rtrim(e=" "){return new i(n.rtrim(this.value,e))}mask(e,t,r=null,s="UTF-8"){return new i(n.mask(this.value,e,t,r,s))}match(e){return new i(n.match(e,this.value))}isMatch(e){return n.isMatch(e,this.value)}matchAll(e){return n.matchAll(e,this.value)}newLine(e=1){return this.append(`
`.repeat(e))}append(...e){return new i(this.value+e.join(""))}prepend(...e){return new i(e.join("")+this.value)}studly(){return new i(n.studly(this.value))}pluralStudly(){return new i(n.pluralStudly(this.value))}substr(e,t=null,r="UTF-8"){return new i(n.substr(this.value,e,t,r))}substrCount(e,t=0,r=null){return n.substrCount(this.value,e,t,r)}substrReplace(e,t,r){return new i(n.substrReplace(this.value,e,t,r))}swap(e){return new i(n.swap(e,this.value))}padBoth(e,t=" "){return new i(n.padBoth(this.value,e,t))}padLeft(e,t=" "){return new i(n.padLeft(this.value,e,t))}padRight(e,t=" "){return new i(n.padRight(this.value,e,t))}repeat(e){return new i(n.repeat(this.value,e))}replaceArray(e,t){return new i(n.replaceArray(e,t,this.value))}replace(e,t,r=!0){return new i(n.replace(e,t,this.value,r))}replaceFirst(e,t){return new i(n.replaceFirst(e,t,this.value))}replaceLast(e,t){return new i(n.replaceFirst(e,t,this.value))}replaceMatches(e,t,r=-1){const s=this.value,a=e instanceof RegExp?e:new RegExp(e,"g");if(typeof t=="function"){const o=s.replace(a,(...h)=>t(h[0],...h.slice(1)));return new i(o)}else{const o=s.replace(a,t);return new i(o)}}wordCount(e=null){return n.wordCount(this.value,e)}words(e=100,t="..."){return new i(n.words(this.value,e,t))}wordWrap(e=75,t=`
`,r=!1){return new i(n.wordWrap(this.value,e,t,r))}exactly(e){const t=e instanceof i?e.toString():e;return this.value===t}explode(e,t=Number.MAX_SAFE_INTEGER){return this.value.split(e,t)}pipe(e){return new i(e(this.value))}position(e,t=0,r=null){return n.position(this.value,e,t,r)}start(e){return new i(n.start(this.value,e))}startsWith(e){return n.startsWith(this.value,e)}take(e){return e<0?this.substr(e):this.substr(0,e)}title(){return new i(n.title(this.value))}slug(e="-",t=null,r={"@":"at"}){return new i(n.slug(this.value,e,t,r))}tap(e){return e&&e(this),this}singular(){return new i(n.singular(this.value))}plural(){return new i(n.plural(this.value))}squish(){return new i(n.squish(this.value))}reverse(){return new i(n.reverse(this.value))}remove(e,t=!0){return new i(n.remove(e,this.value,t))}scan(e){const r=new RegExp(e).exec(this.value);return r?r.slice(1):[]}split(e,t=-1){return typeof e=="number"?this.value.match(new RegExp(`.{1,${e}}`,"g"))||[]:this.value.split(new RegExp(e),t)}test(e){return this.isMatch(e)}when(e,t,r){let s=typeof e=="function"?e():e;return s&&t?t(this):!s&&r?r(this):this}unless(e,t,r){let s=typeof e=="function"?e():e;return!s&&t?t(this):s&&r?r(this):this}toInteger(){return parseInt(this.value,10)}toFloat(){return parseFloat(this.value)}toBoolean(){return["1","true","on","yes"].includes(this.value.toLowerCase())}toDate(e){if(!e)return new Date(this.value);const t={YYYY:"(\\d{4})",MM:"(\\d{2})",DD:"(\\d{2})"};let r=e;for(const A in t)r=r.replace(A,t[A]);const s=new RegExp(r).exec(this.value);if(!s)return null;const a=e.indexOf("YYYY")!==-1?e.split("YYYY")[0].length:-1,o=e.indexOf("MM")!==-1?e.split("MM")[0].length:-1,h=e.indexOf("DD")!==-1?e.split("DD")[0].length:-1,f=a!==-1?parseInt(s[a+1]):0,p=o!==-1?parseInt(s[o+1])-1:0,R=h!==-1?parseInt(s[h+1]):1;return new Date(f,p,R)}toString(){return this.value}}class y{static after(e,t){const r=e.indexOf(t);return r===-1?e:e.substring(r+t.length)}static afterLast(e,t){const r=e.lastIndexOf(t);return r!==-1?e.substring(r+t.length):e}static ascii(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}static before(e,t){const r=e.indexOf(t);return r===-1?e:e.substring(0,r)}static beforeLast(e,t){const r=e.lastIndexOf(t);return r!==-1?e.substring(0,r):e}static between(e,t,r){return t===""||t===null||r===""||r===null?e:y.beforeLast(y.after(e,t),r)}static betweenFirst(e,t,r){return t===""||t===null||r===""||r===null?e:y.before(y.after(e,t),r)}static camel(e){return y.lcfirst(y.studly(e))}static charAt(e,t){const r=e.length;return(t<0?t<-r:t>r-1)?!1:e.charAt(t)}static contains(e,t,r=!1){return r&&(e=e.toLowerCase()),typeof t=="string"&&(t=[t]),t.some(s=>e.includes(s))}static containsAll(e,t,r=!1){for(let s=0;s<t.length;s++)if(!y.contains(e,t[s],r))return!1;return!0}static endsWith(e,t){typeof t=="string"&&(t=[t]);for(let r=0;r<t.length;r++)if(t[r]!==""&&e.endsWith(t[r]))return!0;return!1}static excerpt(e,t="",r={}){const s=r.radius??100,a=r.omission??"...",o=new RegExp(`^(.*?)(${t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")})(.*)$`,"iu"),h=e.match(o);if(!h)return null;let f=h[1];f=f.substring(Math.max(f.length-s,0)),f.length>s&&(f=a+f);let p=h[3];return p=p.substring(0,s),p.length>s&&(p+=a),f+h[2]+p}static finish(e,t){const r=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),s=new RegExp(`(?:${r})+$`,"u");return e.replace(s,"")+t}static wrap(e,t,r=null){return r||(r=t),t+e+r}static headline(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\s+/g," ").trim().toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}static capitalize(e){return e.toLowerCase().replace(/(^\w{1})|(\s+\w{1})/g,t=>t.toUpperCase())}static is(e,t){Array.isArray(e)||(e=[e]);for(const r of e){const s=r.toString();if(s===t)return!0;const o=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/\\\*/g,".*");if(new RegExp("^"+o+"$","u").test(t))return!0}return!1}static isAscii(e){return/^[\x00-\x7F]*$/.test(e)}static isJson(e){try{JSON.parse(e)}catch{return!1}return!0}static isUuid(e){return k(e)}static isUlid(e){return typeof e!="string"?!1:/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/.test(e)}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static kebab(e){return y.snake(e,"-")}static snake(e,t="_"){let r=e.replace(/[\s-]+/g,t).replace(/([A-Z])/g,(s,a)=>t+a.toLowerCase());return r.startsWith(t)&&(r=r.substring(1)),r}static lcfirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static ucfirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static ucsplit(e){return e.split(new RegExp("(?=\\p{Lu})","u")).filter(Boolean)}static length(e,t){return e.length}static limit(e,t=100,r="..."){return e.length>t?e.substring(0,t)+r:e}static lower(e){return e.toLowerCase()}static upper(e){return e.toUpperCase()}static ltrim(e,t=" "){return e.replace(new RegExp(`^[${t}]+`),"")}static trim(e,t=""){let r;if(t){const a=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r=`^[${a}]+|[${a}]+$`}else r="^\\s+|\\s+$";const s=new RegExp(r,"g");return e.replace(s,"")}static rtrim(e,t=" "){return e.replace(new RegExp(`[${t}]+$`),"")}static mask(e,t,r,s=null,a="UTF-8"){if(t==="")return e;const o=s!==null?e.substr(r,s):e.substr(r);if(o==="")return e;const h=r<0?r<-e.length?0:e.length+r:r,f=e.substr(0,h),p=o.length,R=e.substr(h+p);return f+t.charAt(0).repeat(p)+R}static match(e,t){const r=t.match(e);return r?r[1]??r[0]:""}static isMatch(e,t){const r=t.toString();Symbol.iterator in Object(e)?e=Array.from(e):e=[e];for(const s of e)if((s instanceof RegExp?s:new RegExp(s)).test(r))return!0;return!1}static matchAll(e,t){const r=t.matchAll(e);return r?Array.from(r).map(s=>s[1]??s[0]):[]}static password(e=32,t=!0,r=!0,s=!0,a=!1){const o=[];return t&&o.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),r&&o.push(..."0123456789"),s&&o.push(..."~!#$%^&*()-_.,<>?/\\{}[]|:;"),a&&o.push(" "),Array.from({length:e},()=>o[Math.floor(Math.random()*o.length)]).join("")}static studly(e){return e.toLowerCase().replace(/(?:^|\s|-|_)+(.)/g,(t,r)=>r.toUpperCase())}static pluralStudly(e){const t=e.split(/(?=[A-Z])/),r=t.pop()||"";return t.join("")+this.plural(r)}static substr(e,t,r=null,s="UTF-8"){return e.substring(t,r!==null?t+r:void 0)}static substrCount(e,t,r=0,s=null){return s!==null?e.substring(r,r+s).split(t).length-1:e.substring(r).split(t).length-1}static substrReplace(e,t,r,s){if(typeof e=="string"&&typeof t=="string"&&typeof r=="number"&&(typeof s=="number"||s===void 0)){const p=e.substring(0,r),R=e.substring(r+(s??e.length));return`${p}${t}${R}`}else if(Array.isArray(e)&&Array.isArray(t)&&Array.isArray(r)&&(Array.isArray(s)||s===void 0))return e.map((p,R)=>{const A=r[R]??r[0],U=s?s[R]??s[0]:p.length,C=p.substring(0,A),d=p.substring(A+U);return`${C}${t[R]??t[0]}${d}`});throw new Error("Invalid input type. Expected string or array of strings with corresponding types for replace, offset, and length.")}static swap(e,t){return t.replace(new RegExp(Object.keys(e).map(r=>r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),"g"),r=>e[r])}static padBoth(e,t,r=" "){const s=Math.max(0,t-e.length),a=Math.floor(s/2),o=Math.ceil(s/2);return`${r.repeat(a)}${e}${r.repeat(o)}`}static padLeft(e,t,r=" "){const s=Math.max(0,t-e.length);return`${r.repeat(s)}${e}`}static padRight(e,t,r=" "){const s=Math.max(0,t-e.length);return`${e}${r.repeat(s)}`}static repeat(e,t){return e.repeat(t)}static replaceArray(e,t,r){const s=r.split(e);let a=s.shift();for(const o of s)a+=(t.shift()??e)+o;return a}static replace(e,t,r,s=!0){const a=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t],h=s?"":"i",f=new RegExp(a.map(p=>p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),h);return r.replace(f,p=>o.shift()??p)}static replaceFirst(e,t,r){const s=r.indexOf(e);return s!==-1?r.substring(0,s)+t+r.substring(s+e.length):r}static replaceLast(e,t,r){const s=r.lastIndexOf(e);return s!==-1?r.substring(0,s)+t+r.substring(s+e.length):r}static wordCount(e,t=null){const r=`[\\s${t?t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"):""}]+`,s=new RegExp(r,"u");return e.split(s).filter(a=>a.length>0).length}static words(e,t=100,r="..."){const s="^\\s*+(?:\\S++\\s*+){1,"+t+"}",a=new RegExp(s,"u"),o=e.match(a);return!o||o[0].length===e.length?e:o[0].trimEnd()+r}static wordWrap(e,t=75,r=`
`,r=!1){return new i(n.wordWrap(this.value,e,t,r))}exactly(e){const t=e instanceof i?e.toString():e;return this.value===t}explode(e,t=Number.MAX_SAFE_INTEGER){return this.value.split(e,t)}pipe(e){return new i(e(this.value))}position(e,t=0,r=null){return n.position(this.value,e,t,r)}start(e){return new i(n.start(this.value,e))}startsWith(e){return n.startsWith(this.value,e)}take(e){return e<0?this.substr(e):this.substr(0,e)}title(){return new i(n.title(this.value))}slug(e="-",t=null,r={"@":"at"}){return new i(n.slug(this.value,e,t,r))}tap(e){return e&&e(this),this}singular(){return new i(n.singular(this.value))}plural(){return new i(n.plural(this.value))}squish(){return new i(n.squish(this.value))}reverse(){return new i(n.reverse(this.value))}remove(e,t=!0){return new i(n.remove(e,this.value,t))}scan(e){const r=new RegExp(e).exec(this.value);return r?r.slice(1):[]}split(e,t=-1){return typeof e=="number"?this.value.match(new RegExp(`.{1,${e}}`,"g"))||[]:this.value.split(new RegExp(e),t)}test(e){return this.isMatch(e)}when(e,t,r){let s=typeof e=="function"?e():e;return s&&t?t(this):!s&&r?r(this):this}unless(e,t,r){let s=typeof e=="function"?e():e;return!s&&t?t(this):s&&r?r(this):this}toInteger(){return parseInt(this.value,10)}toFloat(){return parseFloat(this.value)}toBoolean(){return["1","true","on","yes"].includes(this.value.toLowerCase())}toDate(e){if(!e)return new Date(this.value);const t={YYYY:"(\\d{4})",MM:"(\\d{2})",DD:"(\\d{2})"};let r=e;for(const A in t)r=r.replace(A,t[A]);const s=new RegExp(r).exec(this.value);if(!s)return null;const a=e.indexOf("YYYY")!==-1?e.split("YYYY")[0].length:-1,o=e.indexOf("MM")!==-1?e.split("MM")[0].length:-1,h=e.indexOf("DD")!==-1?e.split("DD")[0].length:-1,p=a!==-1?parseInt(s[a+1]):0,f=o!==-1?parseInt(s[o+1])-1:0,R=h!==-1?parseInt(s[h+1]):1;return new Date(p,f,R)}toString(){return this.value}}class y{static after(e,t){const r=e.indexOf(t);return r===-1?e:e.substring(r+t.length)}static afterLast(e,t){const r=e.lastIndexOf(t);return r!==-1?e.substring(r+t.length):e}static ascii(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}static before(e,t){const r=e.indexOf(t);return r===-1?e:e.substring(0,r)}static beforeLast(e,t){const r=e.lastIndexOf(t);return r!==-1?e.substring(0,r):e}static between(e,t,r){return t===""||t===null||r===""||r===null?e:y.beforeLast(y.after(e,t),r)}static betweenFirst(e,t,r){return t===""||t===null||r===""||r===null?e:y.before(y.after(e,t),r)}static camel(e){return y.lcfirst(y.studly(e))}static charAt(e,t){const r=e.length;return(t<0?t<-r:t>r-1)?!1:e.charAt(t)}static contains(e,t,r=!1){return r&&(e=e.toLowerCase()),typeof t=="string"&&(t=[t]),t.some(s=>e.includes(s))}static containsAll(e,t,r=!1){for(let s=0;s<t.length;s++)if(!y.contains(e,t[s],r))return!1;return!0}static endsWith(e,t){typeof t=="string"&&(t=[t]);for(let r=0;r<t.length;r++)if(t[r]!==""&&e.endsWith(t[r]))return!0;return!1}static excerpt(e,t="",r={}){const s=r.radius??100,a=r.omission??"...",o=new RegExp(`^(.*?)(${t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")})(.*)$`,"iu"),h=e.match(o);if(!h)return null;let p=h[1];p=p.substring(Math.max(p.length-s,0)),p.length>s&&(p=a+p);let f=h[3];return f=f.substring(0,s),f.length>s&&(f+=a),p+h[2]+f}static finish(e,t){const r=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),s=new RegExp(`(?:${r})+$`,"u");return e.replace(s,"")+t}static wrap(e,t,r=null){return r||(r=t),t+e+r}static headline(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\s+/g," ").trim().toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}static capitalize(e){return e.toLowerCase().replace(/(^\w{1})|(\s+\w{1})/g,t=>t.toUpperCase())}static is(e,t){Array.isArray(e)||(e=[e]);for(const r of e){const s=r.toString();if(s===t)return!0;const o=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/\\\*/g,".*");if(new RegExp("^"+o+"$","u").test(t))return!0}return!1}static isAscii(e){return/^[\x00-\x7F]*$/.test(e)}static isJson(e){try{JSON.parse(e)}catch{return!1}return!0}static isUuid(e){return k(e)}static isUlid(e){return typeof e!="string"?!1:/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/.test(e)}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static kebab(e){return y.snake(e,"-")}static snake(e,t="_"){let r=e.replace(/[\s-]+/g,t).replace(/([A-Z])/g,(s,a)=>t+a.toLowerCase());return r.startsWith(t)&&(r=r.substring(1)),r}static lcfirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static ucfirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static ucsplit(e){return e.split(new RegExp("(?=\\p{Lu})","u")).filter(Boolean)}static length(e,t){return e.length}static limit(e,t=100,r="..."){return e.length>t?e.substring(0,t)+r:e}static lower(e){return e.toLowerCase()}static upper(e){return e.toUpperCase()}static ltrim(e,t=" "){return e.replace(new RegExp(`^[${t}]+`),"")}static trim(e,t=""){let r;if(t){const a=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r=`^[${a}]+|[${a}]+$`}else r="^\\s+|\\s+$";const s=new RegExp(r,"g");return e.replace(s,"")}static rtrim(e,t=" "){return e.replace(new RegExp(`[${t}]+$`),"")}static mask(e,t,r,s=null,a="UTF-8"){if(t==="")return e;const o=s!==null?e.substr(r,s):e.substr(r);if(o==="")return e;const h=r<0?r<-e.length?0:e.length+r:r,p=e.substr(0,h),f=o.length,R=e.substr(h+f);return p+t.charAt(0).repeat(f)+R}static match(e,t){const r=t.match(e);return r?r[1]??r[0]:""}static isMatch(e,t){const r=t.toString();Symbol.iterator in Object(e)?e=Array.from(e):e=[e];for(const s of e)if((s instanceof RegExp?s:new RegExp(s)).test(r))return!0;return!1}static matchAll(e,t){const r=t.matchAll(e);return r?Array.from(r).map(s=>s[1]??s[0]):[]}static password(e=32,t=!0,r=!0,s=!0,a=!1){const o=[];return t&&o.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),r&&o.push(..."0123456789"),s&&o.push(..."~!#$%^&*()-_.,<>?/\\{}[]|:;"),a&&o.push(" "),Array.from({length:e},()=>o[Math.floor(Math.random()*o.length)]).join("")}static studly(e){return e.toLowerCase().replace(/(?:^|\s|-|_)+(.)/g,(t,r)=>r.toUpperCase())}static pluralStudly(e){const t=e.split(/(?=[A-Z])/),r=t.pop()||"";return t.join("")+this.plural(r)}static substr(e,t,r=null,s="UTF-8"){return e.substring(t,r!==null?t+r:void 0)}static substrCount(e,t,r=0,s=null){return s!==null?e.substring(r,r+s).split(t).length-1:e.substring(r).split(t).length-1}static substrReplace(e,t,r,s){if(typeof e=="string"&&typeof t=="string"&&typeof r=="number"&&(typeof s=="number"||s===void 0)){const f=e.substring(0,r),R=e.substring(r+(s??e.length));return`${f}${t}${R}`}else if(Array.isArray(e)&&Array.isArray(t)&&Array.isArray(r)&&(Array.isArray(s)||s===void 0))return e.map((f,R)=>{const A=r[R]??r[0],U=s?s[R]??s[0]:f.length,C=f.substring(0,A),d=f.substring(A+U);return`${C}${t[R]??t[0]}${d}`});throw new Error("Invalid input type. Expected string or array of strings with corresponding types for replace, offset, and length.")}static swap(e,t){return t.replace(new RegExp(Object.keys(e).map(r=>r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),"g"),r=>e[r])}static padBoth(e,t,r=" "){const s=Math.max(0,t-e.length),a=Math.floor(s/2),o=Math.ceil(s/2);return`${r.repeat(a)}${e}${r.repeat(o)}`}static padLeft(e,t,r=" "){const s=Math.max(0,t-e.length);return`${r.repeat(s)}${e}`}static padRight(e,t,r=" "){const s=Math.max(0,t-e.length);return`${e}${r.repeat(s)}`}static repeat(e,t){return e.repeat(t)}static replaceArray(e,t,r){const s=r.split(e);let a=s.shift();for(const o of s)a+=(t.shift()??e)+o;return a}static replace(e,t,r,s=!0){const a=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];let h=r;for(let p=0;p<a.length;p++){const f=new RegExp(a[p].replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),s?"g":"gi");h=h.replace(f,o[p]||a[p])}return h}static replaceFirst(e,t,r){const s=r.indexOf(e);return s!==-1?r.substring(0,s)+t+r.substring(s+e.length):r}static replaceLast(e,t,r){const s=r.lastIndexOf(e);return s!==-1?r.substring(0,s)+t+r.substring(s+e.length):r}static wordCount(e,t=null){const r=`[\\s${t?t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"):""}]+`,s=new RegExp(r,"u");return e.split(s).filter(a=>a.length>0).length}static words(e,t=100,r="..."){const s="^\\s*+(?:\\S++\\s*+){1,"+t+"}",a=new RegExp(s,"u"),o=e.match(a);return!o||o[0].length===e.length?e:o[0].trimEnd()+r}static wordWrap(e,t=75,r=`
`,s=!1){return e.replace(new RegExp(`.{1,${t}}`,"g"),(a,o)=>s&&o%t!==0?a:a+r)}static position(e,t,r=0,s=null){return e.indexOf(t,r)}static start(e,t){const r=t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");return t+e.replace(new RegExp(`^(?:${r})+`,"u"),"")}static startsWith(e,t){return Array.isArray(t)||(t=[t]),t.some(r=>r!==""&&e.startsWith(r))}static take(e,t){return t<0?y.substr(e,t):y.substr(e,0,t)}static title(e){return e.replace(/\b\w+/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}static slug(e,t="-",r=null,s={"@":"at"}){e=r?y.ascii(e):e;let a=e.toLowerCase().replace(/\s+/gu,t);for(const[o,h]of Object.entries(s))a=a.replace(new RegExp(o,"gu"),t+h+t);return a=a.replace(/[^a-z0-9-_\s]+/gu,""),a=a.replace(new RegExp(`[${t}\\s]+`,"gu"),t),a=a.replace(new RegExp(`^${t}+|${t}+$`,"gu"),""),a}static uuid(){return P()}static singular(e){return F.singular(e)}static plural(e){return F.plural(e)}static squish(e){let t=e.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"");return t=t.replace(/(\s|\u3164|\u1160)+/g," "),t}static reverse(e){return Array.from(e).reverse().join("")}static random(e=16){let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++){const a=Math.floor(Math.random()*r.length);t+=r[a]}return t}static remove(e,t,r=!0){Array.isArray(e)||(e=[e]);for(let s of e){const a=RegExp(s,r?"g":"gi");t=t.replace(a,"")}return t}static of(e){return new i(e)}}const n=y;return n});
{
"name": "@akcybex/jstr",
"version": "1.0.16",
"version": "1.0.17",
"private": false,

@@ -5,0 +5,0 @@ "author": "AKCybex",

@@ -108,4 +108,4 @@ # JSTR

| ✔ `JStr.pluralStudly` | Converts the string to plural studly form. | [Documentation](docs/PluralStudly.md) |
| ✔ `JStr.position` | Finds the position of the first occurrence of a substring in the string. | [Documentation](docs/Position.md) |
| ✔ `JStr.random` | Generates a random string. | [Documentation](docs/Random.md) |
| ✔✔ `JStr.position` | Finds the position of the first occurrence of a substring in the string. | [Documentation](docs/Position.md) |
| ✔✔ `JStr.random` | Generates a random string. | [Documentation](docs/Random.md) |
| ✔✔ `JStr.remove` | Removes a specified substring from the string. | [Documentation](docs/Remove.md) |

@@ -201,3 +201,3 @@ | ✔✔ `JStr.repeat` | Repeats the string a specified number of times. | [Documentation](docs/Repeat.md) |

| ✔ `plural` | Converts the string to plural form. | [Documentation](docs/Plural.md) |
| ✔ `position` | Finds the position of the first occurrence of a substring in the string. | [Documentation](docs/Position.md) |
| ✔✔ `position` | Finds the position of the first occurrence of a substring in the string. | [Documentation](docs/Position.md) |
| ✔ `prepend` | Prepends a string or an array of strings to the beginning of the current string. | [Documentation](docs/Prepend.md) |

@@ -230,3 +230,3 @@ | ✔✔ `remove` | Removes a specified substring from the string. | [Documentation](docs/Remove.md) |

| ✔ `test` | Performs a regular expression match on the string and returns a boolean. | [Documentation](docs/Test.md) |
| ✔ `title` | Converts the first character of each word in the string to uppercase. | [Documentation](docs/Title.md) |
| ✔✔ `title` | Converts the first character of each word in the string to uppercase. | [Documentation](docs/Title.md) |
| ✔✔ `trim` | Removes whitespace from the beginning and end of the string. | [Documentation](docs/Trim.md) |

@@ -233,0 +233,0 @@ | ✔✔ `ucfirst` | Converts the first character of the string to uppercase. | [Documentation](docs/Ucfirst.md) |

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc