Comparing version 1.0.1 to 1.0.2
@@ -1,1 +0,1 @@ | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e._s=r()}}(function(){return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var v="function"==typeof require&&require;if(!u&&v)return v(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[o]={exports:{}};e[o][0].call(f.exports,function(r){var n=e[o][1][r];return i(n?n:r)},f,f.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)i(t[o]);return i}({1:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isArray=function(r){return null!==r&&r.length>=0&&"[object Array]"===Object.prototype.toString.call(r)},n._pop=function(r){for(var e=[],n=0;n<r.length-1;n++)e[n]=r[n];return e}},{}],2:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ascii={0:["°","₀","۰"],1:["¹","₁","۱"],2:["²","₂","۲"],3:["³","₃","۳"],4:["⁴","₄","۴","٤"],5:["⁵","₅","۵","٥"],6:["⁶","₆","۶","٦"],7:["⁷","₇","۷"],8:["⁸","₈","۸"],9:["⁹","₉","۹"],a:["à","á","ả","ã","ạ","ă","ắ","ằ","ẳ","ẵ","ặ","â","ấ","ầ","ẩ","ẫ","ậ","ā","ą","å","α","ά","ἀ","ἁ","ἂ","ἃ","ἄ","ἅ","ἆ","ἇ","ᾀ","ᾁ","ᾂ","ᾃ","ᾄ","ᾅ","ᾆ","ᾇ","ὰ","ά","ᾰ","ᾱ","ᾲ","ᾳ","ᾴ","ᾶ","ᾷ","а","أ","အ","ာ","ါ","ǻ","ǎ","ª","ა","अ","ا"],b:["б","β","Ъ","Ь","ب","ဗ","ბ"],c:["ç","ć","č","ĉ","ċ"],d:["ď","ð","đ","ƌ","ȡ","ɖ","ɗ","ᵭ","ᶁ","ᶑ","д","δ","د","ض","ဍ","ဒ","დ"],e:["é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ","ë","ē","ę","ě","ĕ","ė","ε","έ","ἐ","ἑ","ἒ","ἓ","ἔ","ἕ","ὲ","έ","е","ё","э","є","ə","ဧ","ေ","ဲ","ე","ए","إ","ئ"],f:["ф","φ","ف","ƒ","ფ"],g:["ĝ","ğ","ġ","ģ","г","ґ","γ","ဂ","გ","گ"],h:["ĥ","ħ","η","ή","ح","ه","ဟ","ှ","ჰ"],i:["í","ì","ỉ","ĩ","ị","î","ï","ī","ĭ","į","ı","ι","ί","ϊ","ΐ","ἰ","ἱ","ἲ","ἳ","ἴ","ἵ","ἶ","ἷ","ὶ","ί","ῐ","ῑ","ῒ","ΐ","ῖ","ῗ","і","ї","и","ဣ","ိ","ီ","ည်","ǐ","ი","इ","ی"],j:["ĵ","ј","Ј","ჯ","ج"],k:["ķ","ĸ","к","κ","Ķ","ق","ك","က","კ","ქ","ک"],l:["ł","ľ","ĺ","ļ","ŀ","л","λ","ل","လ","ლ"],m:["м","μ","م","မ","მ"],n:["ñ","ń","ň","ņ","ʼn","ŋ","ν","н","ن","န","ნ"],o:["ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ","ø","ō","ő","ŏ","ο","ὀ","ὁ","ὂ","ὃ","ὄ","ὅ","ὸ","ό","о","و","θ","ို","ǒ","ǿ","º","ო","ओ"],p:["п","π","ပ","პ","پ"],q:["ყ"],r:["ŕ","ř","ŗ","р","ρ","ر","რ"],s:["ś","š","ş","с","σ","ș","ς","س","ص","စ","ſ","ს"],t:["ť","ţ","т","τ","ț","ت","ط","ဋ","တ","ŧ","თ","ტ"],u:["ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự","û","ū","ů","ű","ŭ","ų","µ","у","ဉ","ု","ူ","ǔ","ǖ","ǘ","ǚ","ǜ","უ","उ"],v:["в","ვ","ϐ"],w:["ŵ","ω","ώ","ဝ","ွ"],x:["χ","ξ"],y:["ý","ỳ","ỷ","ỹ","ỵ","ÿ","ŷ","й","ы","υ","ϋ","ύ","ΰ","ي","ယ"],z:["ź","ž","ż","з","ζ","ز","ဇ","ზ"],aa:["ع","आ","آ"],ae:["ä","æ","ǽ"],ai:["ऐ"],at:["@"],ch:["ч","ჩ","ჭ","چ"],dj:["ђ","đ"],dz:["џ","ძ"],ei:["ऍ"],gh:["غ","ღ"],ii:["ई"],ij:["ij"],kh:["х","خ","ხ"],lj:["љ"],nj:["њ"],oe:["ö","œ","ؤ"],oi:["ऑ"],oii:["ऒ"],ps:["ψ"],sh:["ш","შ","ش"],shch:["щ"],ss:["ß"],sx:["ŝ"],th:["þ","ϑ","ث","ذ","ظ"],ts:["ц","ც","წ"],ue:["ü"],uu:["ऊ"],ya:["я"],yu:["ю"],zh:["ж","ჟ","ژ"],"(c)":["©"],A:["Á","À","Ả","Ã","Ạ","Ă","Ắ","Ằ","Ẳ","Ẵ","Ặ","Â","Ấ","Ầ","Ẩ","Ẫ","Ậ","Å","Ā","Ą","Α","Ά","Ἀ","Ἁ","Ἂ","Ἃ","Ἄ","Ἅ","Ἆ","Ἇ","ᾈ","ᾉ","ᾊ","ᾋ","ᾌ","ᾍ","ᾎ","ᾏ","Ᾰ","Ᾱ","Ὰ","Ά","ᾼ","А","Ǻ","Ǎ"],B:["Б","Β","ब"],C:["Ç","Ć","Č","Ĉ","Ċ"],D:["Ď","Ð","Đ","Ɖ","Ɗ","Ƌ","ᴅ","ᴆ","Д","Δ"],E:["É","È","Ẻ","Ẽ","Ẹ","Ê","Ế","Ề","Ể","Ễ","Ệ","Ë","Ē","Ę","Ě","Ĕ","Ė","Ε","Έ","Ἐ","Ἑ","Ἒ","Ἓ","Ἔ","Ἕ","Έ","Ὲ","Е","Ё","Э","Є","Ə"],F:["Ф","Φ"],G:["Ğ","Ġ","Ģ","Г","Ґ","Γ"],H:["Η","Ή","Ħ"],I:["Í","Ì","Ỉ","Ĩ","Ị","Î","Ï","Ī","Ĭ","Į","İ","Ι","Ί","Ϊ","Ἰ","Ἱ","Ἳ","Ἴ","Ἵ","Ἶ","Ἷ","Ῐ","Ῑ","Ὶ","Ί","И","І","Ї","Ǐ","ϒ"],K:["К","Κ"],L:["Ĺ","Ł","Л","Λ","Ļ","Ľ","Ŀ","ल"],M:["М","Μ"],N:["Ń","Ñ","Ň","Ņ","Ŋ","Н","Ν"],O:["Ó","Ò","Ỏ","Õ","Ọ","Ô","Ố","Ồ","Ổ","Ỗ","Ộ","Ơ","Ớ","Ờ","Ở","Ỡ","Ợ","Ø","Ō","Ő","Ŏ","Ο","Ό","Ὀ","Ὁ","Ὂ","Ὃ","Ὄ","Ὅ","Ὸ","Ό","О","Θ","Ө","Ǒ","Ǿ"],P:["П","Π"],R:["Ř","Ŕ","Р","Ρ","Ŗ"],S:["Ş","Ŝ","Ș","Š","Ś","С","Σ"],T:["Ť","Ţ","Ŧ","Ț","Т","Τ"],U:["Ú","Ù","Ủ","Ũ","Ụ","Ư","Ứ","Ừ","Ử","Ữ","Ự","Û","Ū","Ů","Ű","Ŭ","Ų","У","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ"],V:["В"],W:["Ω","Ώ","Ŵ"],X:["Χ","Ξ"],Y:["Ý","Ỳ","Ỷ","Ỹ","Ỵ","Ÿ","Ῠ","Ῡ","Ὺ","Ύ","Ы","Й","Υ","Ϋ","Ŷ"],Z:["Ź","Ž","Ż","З","Ζ"],AE:["Ä","Æ","Ǽ"],CH:["Ч"],DJ:["Ђ"],DZ:["Џ"],GX:["Ĝ"],HX:["Ĥ"],IJ:["IJ"],JX:["Ĵ"],KH:["Х"],LJ:["Љ"],NJ:["Њ"],OE:["Ö","Œ"],PS:["Ψ"],SH:["Ш"],SHCH:["Щ"],SS:["ẞ"],TH:["Þ"],TS:["Ц"],UE:["Ü"],YA:["Я"],YU:["Ю"],ZH:["Ж"]," ":[" ","â","â","â","â","â","â ","â","â","â","â","â","â¯","â","ã"]}},{}],3:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isNumber=function(r){return"[object Number]"===Object.prototype.toString.call(r)}},{}],4:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.validCharLength=n.validNumber=n.validArrayString=n.validString=void 0;var t=r("../string.utils.js"),i=r("./number"),a=function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return!0};n.validString=a;var o=function(r){return r.map(function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return r}),!0};n.validArrayString=o;var u=function(r){if(!(0,i._isNumber)(r))throw new Error("[strman] "+r+" is not a Number.");return!0};n.validNumber=u;var v=function(r){if(0===(0,t.length)(r))throw new Error("Char should be length >= 1");return!0};n.validCharLength=v},{"../string.utils.js":7,"./number":3}],5:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.slugify=void 0;var t=r("./strman"),i=function(r){var e=r;return e=(0,t.toLowerCase)(e),e=(0,t.trim)(e),e=(0,t.removeSpaces)(e,"-"),e=(0,t.replace)(e,"&","-and-"),e=(0,t.replace)(e,"--+","-"),e=(0,t.removeNonChars)(e),e=(0,t.replace)(e,"[^\\w\\-]+","")};n.slugify=i},{"./strman":8}],6:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(r){return r.toLowerCase()};n.toLowerCase=t;var i=function(r){return r.toUpperCase()};n.toUpperCase=i;var a=function(r){return r===t(r)};n.isLowerCase=a;var o=function(r){return r===i(r)};n.isUpperCase=o;var u=function(r){var e=r.replace(/[\-_\s]+(.)?/g,function(r,e){return e?i(e):""});return i(e.substr(0,1))+e.substr(1)};n.toStudlyCaps=u;var v=function(r){var e=u(r);return t(e.substr(0,1))+e.substr(1)};n.toCamelCase=v;var s=function(r){var e=arguments.length<=1||void 0===arguments[1]?"_":arguments[1],n=v(r),i=n.replace(/([A-Z])+/g,e+"$1");return t(i)};n.toDecamelize=s;var f=function(r){return s(r,"_")};n.toSnakeCase=f;var c=function(r){return s(r,"-")};n.toKebabCase=c},{}],7:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.truncate=n.safeTruncate=n.slice=n.surround=n.shuffle=n.reverse=n.repeat=n.removeRight=n.removeLeft=n.prependArray=n.prepend=n.split=n.substr=n.rightPad=n.leftPad=n.length=n.insert=n.lastIndexOf=n.indexOf=n.last=n.first=n.ensureRight=n.ensureLeft=n.startsWith=n.endsWith=n.countSubstr=n.containsAny=n.containsAll=n.contains=n.includes=n.removeNonWords=n.collapseWhitespace=n.chars=n.between=n.at=n.appendArray=n.append=n.removeNonChars=n.replace=n.removeSpaces=n.rightTrim=n.leftTrim=n.trim=n.isString=void 0;var t=r("./lib/ascii"),i=r("./lib/array"),a=r("./lib/validate"),o=r("./string.cases"),u=function(r){return"[object String]"===Object.prototype.toString.call(r)};n.isString=u;var v=function(r){return s(f(r))};n.trim=v;var s=function(r){return l(r,"^\\s+","")};n.leftTrim=s;var f=function(r){return l(r,"\\s+$","")};n.rightTrim=f;var c=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return l(r,"\\s+",e)};n.removeSpaces=c;var l=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2];return r.replace(new RegExp(e,"g"),n)};n.replace=l;var d=function(r){var e=r;for(var n in t.ascii)for(var i in t.ascii[n])e=l(e,t.ascii[n][i],n);return e};n.removeNonChars=d;var g=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:r+n.join("")};n.append=g;var p=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:r+e.join("")};n.appendArray=p;var h=function(r,e){return(0,a.validString)(r),(0,a.validNumber)(e),R(r,e,1)};n.at=h;var b=function(r,e,n){var t=null;return(0,a.validArrayString)([r,e,n]),t=q(r,n),t=t.map(function(r){return R(r,U(r,e)+W(e))}),t=(0,i._pop)(t)};n.between=b;var y=function(r){var e=[];(0,a.validString)(r);for(var n=0;n<W(r);n++)e[n]=h(r,n);return e};n.chars=y;var m=function(r){return v(l(r,"\\s\\s+"," "))};n.collapseWhitespace=m;var S=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return l(r,"[^\\w]+",e)};n.removeNonWords=S;var j=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return C(r,e,n)};n.includes=j;var C=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return n?U(r,e)>-1:U((0,o.toUpperCase)(r),(0,o.toUpperCase)(e))>-1};n.contains=C;var O=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(!C(r,e[t],n))return!1;return!0};n.containsAll=O;var _=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(C(r,e[t],n))return!0;return!1};n.containsAny=_;var w=function Q(r,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],t=arguments.length<=3||void 0===arguments[3]?0:arguments[3],i=arguments.length<=4||void 0===arguments[4]?0:arguments[4],a=U(r,e,t);return-1===a?i:(n||(a=a+W(e)-1),Q(r,e,n,a+1,i+1))},A=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return n||(r=(0,o.toUpperCase)(r),e=(0,o.toUpperCase)(e)),w(r,e,t)};n.countSubstr=A;var P=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],t=null;return("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>W(r))&&(n=W(r)),n-=W(e),t=U(r,e,n),-1!==t&&t===n};n.endsWith=P;var N=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return R(r,n,W(e))===e};n.startsWith=N;var x=function(r,e){return N(r,e)?r:g(e,r)};n.ensureLeft=x;var L=function(r,e){return P(r,e)?r:g(r,e)};n.ensureRight=L;var E=function(r,e){return R(r,0,e)};n.first=E;var M=function(r,e){return R(r,-1*e,e)};n.last=M;var U=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return r.indexOf(e,n)};n.indexOf=U;var T=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.lastIndexOf(e,n)};n.lastIndexOf=T;var H=function(r,e,n){var t=null,i=null;return n>W(r)?r:(t=R(r,0,n),i=R(r,n,W(r)),g(t,e,i))};n.insert=H;var W=function(r){return r.length};n.length=W;var k=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=R(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=g(Z(n,e),t)};n.leftPad=k;var D=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=R(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=g(t,Z(n,e))};n.rightPad=D;var R=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.substr(e,n)};n.substr=R;var q=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.split(e,n)};n.split=q;var I=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:n.join("")+r};n.prepend=I;var J=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:e.join("")+r};n.prependArray=J;var z=function(r,e){return N(r,e)?R(r,W(e)):r};n.removeLeft=z;var X=function(r,e){var n=W(r)-W(e);return P(r,e)?R(r,0,n):r};n.removeRight=X;var Z=function(r,e){for(var n=0,t="";e>n++;)t+=r;return t};n.repeat=Z;var F=function(r){for(var e=0,n="";W(r)>e++;)n=g(n,R(r,-1*e,1));return n};n.reverse=F;var K=function(r){var e=void 0,n=void 0,t=void 0;for(t=W(r);t;t-=1)e=Math.floor(Math.random()*t),n=r[t-1],r[t-1]=r[e],r[e]=n;return r},Y=function(r){return K(q(r)).join("")};n.shuffle=Y;var G=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return g(e,r,e)};n.surround=G;var $=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.slice(e,n)};n.slice=$;var B=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";if(0===e)return"";if(e>=W(r))return r;if(e===U(r," ",0))return R(r,0,e);e-=W(n),t=R(r,0,e);var i=U(r," ",e-1);if(i!==e){var a=T(t," ",0);t=R(t,0,a)}return g(t,n)};n.safeTruncate=B;var V=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";return 0===e?"":e>=W(r)?r:(e-=W(n),t=R(r,0,e),g(t,n))};n.truncate=V},{"./lib/array":1,"./lib/ascii":2,"./lib/validate":4,"./string.cases":6}],8:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r("./slugify");Object.keys(t).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return t[r]}})});var i=r("./string.utils");Object.keys(i).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return i[r]}})});var a=r("./string.cases");Object.keys(a).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return a[r]}})})},{"./slugify":5,"./string.cases":6,"./string.utils":7}]},{},[8])(8)}); | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e._s=r()}}(function(){return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var v="function"==typeof require&&require;if(!u&&v)return v(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(r){var n=e[o][1][r];return i(n?n:r)},l,l.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)i(t[o]);return i}({1:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isArray=function(r){return null!==r&&r.length>=0&&"[object Array]"===Object.prototype.toString.call(r)},n._pop=function(r){for(var e=[],n=0;n<r.length-1;n++)e[n]=r[n];return e}},{}],2:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ascii={0:["°","₀","۰"],1:["¹","₁","۱"],2:["²","₂","۲"],3:["³","₃","۳"],4:["⁴","₄","۴","٤"],5:["⁵","₅","۵","٥"],6:["⁶","₆","۶","٦"],7:["⁷","₇","۷"],8:["⁸","₈","۸"],9:["⁹","₉","۹"],a:["à","á","ả","ã","ạ","ă","ắ","ằ","ẳ","ẵ","ặ","â","ấ","ầ","ẩ","ẫ","ậ","ā","ą","å","α","ά","ἀ","ἁ","ἂ","ἃ","ἄ","ἅ","ἆ","ἇ","ᾀ","ᾁ","ᾂ","ᾃ","ᾄ","ᾅ","ᾆ","ᾇ","ὰ","ά","ᾰ","ᾱ","ᾲ","ᾳ","ᾴ","ᾶ","ᾷ","а","أ","အ","ာ","ါ","ǻ","ǎ","ª","ა","अ","ا"],b:["б","β","Ъ","Ь","ب","ဗ","ბ"],c:["ç","ć","č","ĉ","ċ"],d:["ď","ð","đ","ƌ","ȡ","ɖ","ɗ","ᵭ","ᶁ","ᶑ","д","δ","د","ض","ဍ","ဒ","დ"],e:["é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ","ë","ē","ę","ě","ĕ","ė","ε","έ","ἐ","ἑ","ἒ","ἓ","ἔ","ἕ","ὲ","έ","е","ё","э","є","ə","ဧ","ေ","ဲ","ე","ए","إ","ئ"],f:["ф","φ","ف","ƒ","ფ"],g:["ĝ","ğ","ġ","ģ","г","ґ","γ","ဂ","გ","گ"],h:["ĥ","ħ","η","ή","ح","ه","ဟ","ှ","ჰ"],i:["í","ì","ỉ","ĩ","ị","î","ï","ī","ĭ","į","ı","ι","ί","ϊ","ΐ","ἰ","ἱ","ἲ","ἳ","ἴ","ἵ","ἶ","ἷ","ὶ","ί","ῐ","ῑ","ῒ","ΐ","ῖ","ῗ","і","ї","и","ဣ","ိ","ီ","ည်","ǐ","ი","इ","ی"],j:["ĵ","ј","Ј","ჯ","ج"],k:["ķ","ĸ","к","κ","Ķ","ق","ك","က","კ","ქ","ک"],l:["ł","ľ","ĺ","ļ","ŀ","л","λ","ل","လ","ლ"],m:["м","μ","م","မ","მ"],n:["ñ","ń","ň","ņ","ʼn","ŋ","ν","н","ن","န","ნ"],o:["ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ","ø","ō","ő","ŏ","ο","ὀ","ὁ","ὂ","ὃ","ὄ","ὅ","ὸ","ό","о","و","θ","ို","ǒ","ǿ","º","ო","ओ"],p:["п","π","ပ","პ","پ"],q:["ყ"],r:["ŕ","ř","ŗ","р","ρ","ر","რ"],s:["ś","š","ş","с","σ","ș","ς","س","ص","စ","ſ","ს"],t:["ť","ţ","т","τ","ț","ت","ط","ဋ","တ","ŧ","თ","ტ"],u:["ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự","û","ū","ů","ű","ŭ","ų","µ","у","ဉ","ု","ူ","ǔ","ǖ","ǘ","ǚ","ǜ","უ","उ"],v:["в","ვ","ϐ"],w:["ŵ","ω","ώ","ဝ","ွ"],x:["χ","ξ"],y:["ý","ỳ","ỷ","ỹ","ỵ","ÿ","ŷ","й","ы","υ","ϋ","ύ","ΰ","ي","ယ"],z:["ź","ž","ż","з","ζ","ز","ဇ","ზ"],aa:["ع","आ","آ"],ae:["ä","æ","ǽ"],ai:["ऐ"],at:["@"],ch:["ч","ჩ","ჭ","چ"],dj:["ђ","đ"],dz:["џ","ძ"],ei:["ऍ"],gh:["غ","ღ"],ii:["ई"],ij:["ij"],kh:["х","خ","ხ"],lj:["љ"],nj:["њ"],oe:["ö","œ","ؤ"],oi:["ऑ"],oii:["ऒ"],ps:["ψ"],sh:["ш","შ","ش"],shch:["щ"],ss:["ß"],sx:["ŝ"],th:["þ","ϑ","ث","ذ","ظ"],ts:["ц","ც","წ"],ue:["ü"],uu:["ऊ"],ya:["я"],yu:["ю"],zh:["ж","ჟ","ژ"],"(c)":["©"],A:["Á","À","Ả","Ã","Ạ","Ă","Ắ","Ằ","Ẳ","Ẵ","Ặ","Â","Ấ","Ầ","Ẩ","Ẫ","Ậ","Å","Ā","Ą","Α","Ά","Ἀ","Ἁ","Ἂ","Ἃ","Ἄ","Ἅ","Ἆ","Ἇ","ᾈ","ᾉ","ᾊ","ᾋ","ᾌ","ᾍ","ᾎ","ᾏ","Ᾰ","Ᾱ","Ὰ","Ά","ᾼ","А","Ǻ","Ǎ"],B:["Б","Β","ब"],C:["Ç","Ć","Č","Ĉ","Ċ"],D:["Ď","Ð","Đ","Ɖ","Ɗ","Ƌ","ᴅ","ᴆ","Д","Δ"],E:["É","È","Ẻ","Ẽ","Ẹ","Ê","Ế","Ề","Ể","Ễ","Ệ","Ë","Ē","Ę","Ě","Ĕ","Ė","Ε","Έ","Ἐ","Ἑ","Ἒ","Ἓ","Ἔ","Ἕ","Έ","Ὲ","Е","Ё","Э","Є","Ə"],F:["Ф","Φ"],G:["Ğ","Ġ","Ģ","Г","Ґ","Γ"],H:["Η","Ή","Ħ"],I:["Í","Ì","Ỉ","Ĩ","Ị","Î","Ï","Ī","Ĭ","Į","İ","Ι","Ί","Ϊ","Ἰ","Ἱ","Ἳ","Ἴ","Ἵ","Ἶ","Ἷ","Ῐ","Ῑ","Ὶ","Ί","И","І","Ї","Ǐ","ϒ"],K:["К","Κ"],L:["Ĺ","Ł","Л","Λ","Ļ","Ľ","Ŀ","ल"],M:["М","Μ"],N:["Ń","Ñ","Ň","Ņ","Ŋ","Н","Ν"],O:["Ó","Ò","Ỏ","Õ","Ọ","Ô","Ố","Ồ","Ổ","Ỗ","Ộ","Ơ","Ớ","Ờ","Ở","Ỡ","Ợ","Ø","Ō","Ő","Ŏ","Ο","Ό","Ὀ","Ὁ","Ὂ","Ὃ","Ὄ","Ὅ","Ὸ","Ό","О","Θ","Ө","Ǒ","Ǿ"],P:["П","Π"],R:["Ř","Ŕ","Р","Ρ","Ŗ"],S:["Ş","Ŝ","Ș","Š","Ś","С","Σ"],T:["Ť","Ţ","Ŧ","Ț","Т","Τ"],U:["Ú","Ù","Ủ","Ũ","Ụ","Ư","Ứ","Ừ","Ử","Ữ","Ự","Û","Ū","Ů","Ű","Ŭ","Ų","У","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ"],V:["В"],W:["Ω","Ώ","Ŵ"],X:["Χ","Ξ"],Y:["Ý","Ỳ","Ỷ","Ỹ","Ỵ","Ÿ","Ῠ","Ῡ","Ὺ","Ύ","Ы","Й","Υ","Ϋ","Ŷ"],Z:["Ź","Ž","Ż","З","Ζ"],AE:["Ä","Æ","Ǽ"],CH:["Ч"],DJ:["Ђ"],DZ:["Џ"],GX:["Ĝ"],HX:["Ĥ"],IJ:["IJ"],JX:["Ĵ"],KH:["Х"],LJ:["Љ"],NJ:["Њ"],OE:["Ö","Œ"],PS:["Ψ"],SH:["Ш"],SHCH:["Щ"],SS:["ẞ"],TH:["Þ"],TS:["Ц"],UE:["Ü"],YA:["Я"],YU:["Ю"],ZH:["Ж"]," ":[" ","â","â","â","â","â","â ","â","â","â","â","â","â¯","â","ã"]}},{}],3:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isNumber=function(r){return"[object Number]"===Object.prototype.toString.call(r)}},{}],4:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.validCharLength=n.validNumber=n.validArrayString=n.validString=void 0;var t=r("../string.utils.js"),i=r("./number"),a=function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return!0};n.validString=a;var o=function(r){return r.map(function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return r}),!0};n.validArrayString=o;var u=function(r){if(!(0,i._isNumber)(r))throw new Error("[strman] "+r+" is not a Number.");return!0};n.validNumber=u;var v=function(r){if(0===(0,t.length)(r))throw new Error("Char should be length >= 1");return!0};n.validCharLength=v},{"../string.utils.js":7,"./number":3}],5:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.slugify=void 0;var t=r("./strman"),i=function(r){var e=r;return e=(0,t.toLowerCase)(e),e=(0,t.trim)(e),e=(0,t.removeSpaces)(e,"-"),e=(0,t.replace)(e,"&","-and-"),e=(0,t.transliterate)(e),e=(0,t.replace)(e,"[^\\w\\-]+",""),e=(0,t.replace)(e,"--+","-")};n.slugify=i},{"./strman":8}],6:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(r){return r.toLowerCase()};n.toLowerCase=t;var i=function(r){return r.toUpperCase()};n.toUpperCase=i;var a=function(r){return r===t(r)};n.isLowerCase=a;var o=function(r){return r===i(r)};n.isUpperCase=o;var u=function(r){var e=r.replace(/[\-_\s]+(.)?/g,function(r,e){return e?i(e):""});return i(e.substr(0,1))+e.substr(1)};n.toStudlyCaps=u;var v=function(r){var e=u(r);return t(e.substr(0,1))+e.substr(1)};n.toCamelCase=v;var s=function(r){var e=arguments.length<=1||void 0===arguments[1]?"_":arguments[1],n=v(r),i=n.replace(/([A-Z])+/g,e+"$1");return t(i)};n.toDecamelize=s;var l=function(r){return s(r,"_")};n.toSnakeCase=l;var f=function(r){return s(r,"-")};n.toKebabCase=f},{}],7:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.truncate=n.safeTruncate=n.slice=n.surround=n.shuffle=n.reverse=n.repeat=n.removeRight=n.removeLeft=n.prependArray=n.prepend=n.split=n.substr=n.rightPad=n.leftPad=n.length=n.insert=n.lastIndexOf=n.indexOf=n.last=n.first=n.ensureRight=n.ensureLeft=n.startsWith=n.endsWith=n.countSubstr=n.containsAny=n.containsAll=n.contains=n.removeNonWords=n.collapseWhitespace=n.chars=n.between=n.at=n.appendArray=n.append=n.removeNonChars=n.transliterate=n.replace=n.removeSpaces=n.rightTrim=n.leftTrim=n.trim=n.isString=void 0;var t=r("./lib/ascii"),i=r("./lib/array"),a=r("./lib/validate"),o=r("./string.cases"),u=function(r){return"[object String]"===Object.prototype.toString.call(r)};n.isString=u;var v=function(r){return s(l(r))};n.trim=v;var s=function(r){return c(r,"^\\s+","")};n.leftTrim=s;var l=function(r){return c(r,"\\s+$","")};n.rightTrim=l;var f=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return c(r,"\\s+",e)};n.removeSpaces=f;var c=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.replace(new RegExp(e,"g"),n):r.replace(new RegExp(e,"ig"),n)};n.replace=c;var d=function(r){var e=r;for(var n in t.ascii)for(var i in t.ascii[n])e=c(e,t.ascii[n][i],n);return e};n.transliterate=d;var g=d;n.removeNonChars=g;var p=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:r+n.join("")};n.append=p;var h=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:r+e.join("")};n.appendArray=h;var b=function(r,e){return(0,a.validString)(r),(0,a.validNumber)(e),D(r,e,1)};n.at=b;var y=function(r,e,n){var t=null;return(0,a.validArrayString)([r,e,n]),t=I(r,n),t=t.map(function(r){return D(r,M(r,e)+W(e))}),t=(0,i._pop)(t)};n.between=y;var m=function(r){var e=[];(0,a.validString)(r);for(var n=0;n<W(r);n++)e[n]=b(r,n);return e};n.chars=m;var S=function(r){return v(c(r,"\\s\\s+"," "))};n.collapseWhitespace=S;var C=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return c(r,"[^\\w]+",e)};n.removeNonWords=C;var j=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return n?M(r,e)>-1:M((0,o.toUpperCase)(r),(0,o.toUpperCase)(e))>-1};n.contains=j;var O=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(!j(r,e[t],n))return!1;return!0};n.containsAll=O;var _=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(j(r,e[t],n))return!0;return!1};n.containsAny=_;var w=function Q(r,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],t=arguments.length<=3||void 0===arguments[3]?0:arguments[3],i=arguments.length<=4||void 0===arguments[4]?0:arguments[4],a=M(r,e,t);return-1===a?i:(n||(a=a+W(e)-1),Q(r,e,n,a+1,i+1))},A=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return n||(r=(0,o.toUpperCase)(r),e=(0,o.toUpperCase)(e)),w(r,e,t)};n.countSubstr=A;var U=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3],i=null;return("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>W(r))&&(n=W(r)),n-=W(e),i=t?M(r,e,n):M((0,o.toUpperCase)(r),(0,o.toUpperCase)(e),n),-1!==i&&i===n};n.endsWith=U;var x=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?D(r,n,W(e))===e:D((0,o.toUpperCase)(r),n,W(e))===(0,o.toUpperCase)(e)};n.startsWith=x;var P=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return x(r,e,0,n)?r:p(e,r)};n.ensureLeft=P;var E=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return U(r,e,null,n)?r:p(r,e)};n.ensureRight=E;var L=function(r,e){return D(r,0,e)};n.first=L;var N=function(r,e){return D(r,-1*e,e)};n.last=N;var M=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.indexOf(e,n):(0,o.toUpperCase)(r).indexOf((0,o.toUpperCase)(e),n)};n.indexOf=M;var T=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.lastIndexOf(e,n):(0,o.toUpperCase)(r).lastIndexOf((0,o.toUpperCase)(e),n)};n.lastIndexOf=T;var H=function(r,e,n){var t=null,i=null;return n>W(r)?r:(t=D(r,0,n),i=D(r,n,W(r)),p(t,e,i))};n.insert=H;var W=function(r){return r.length};n.length=W;var R=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=D(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=p(Z(n,e),t)};n.leftPad=R;var k=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=D(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=p(t,Z(n,e))};n.rightPad=k;var D=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.substr(e,n)};n.substr=D;var I=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.split(e,n)};n.split=I;var q=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:n.join("")+r};n.prepend=q;var J=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:e.join("")+r};n.prependArray=J;var z=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return x(r,e,0,n)?D(r,W(e)):r};n.removeLeft=z;var X=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=W(r)-W(e);return U(r,e,null,n)?D(r,0,t):r};n.removeRight=X;var Z=function(r,e){for(var n=0,t="";e>n++;)t+=r;return t};n.repeat=Z;var F=function(r){for(var e=0,n="";W(r)>e++;)n=p(n,D(r,-1*e,1));return n};n.reverse=F;var K=function(r){var e=void 0,n=void 0,t=void 0;for(t=W(r);t;t-=1)e=Math.floor(Math.random()*t),n=r[t-1],r[t-1]=r[e],r[e]=n;return r},Y=function(r){return K(I(r)).join("")};n.shuffle=Y;var G=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return p(e,r,e)};n.surround=G;var $=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.slice(e,n)};n.slice=$;var B=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";if(0===e)return"";if(e>=W(r))return r;if(e===M(r," ",0))return D(r,0,e);e-=W(n),t=D(r,0,e);var i=M(r," ",e-1);if(i!==e){var a=T(t," ",0);t=D(t,0,a)}return p(t,n)};n.safeTruncate=B;var V=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";return 0===e?"":e>=W(r)?r:(e-=W(n),t=D(r,0,e),p(t,n))};n.truncate=V},{"./lib/array":1,"./lib/ascii":2,"./lib/validate":4,"./string.cases":6}],8:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r("./slugify");Object.keys(t).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return t[r]}})});var i=r("./string.utils");Object.keys(i).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return i[r]}})});var a=r("./string.cases");Object.keys(a).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return a[r]}})})},{"./slugify":5,"./string.cases":6,"./string.utils":7}]},{},[8])(8)}); |
{ | ||
"name": "strman", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Javascript string manipulation library without npm dependences.", | ||
@@ -5,0 +5,0 @@ "main": "dist/strman.js", |
@@ -1,1 +0,1 @@ | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e._s=r()}}(function(){return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var v="function"==typeof require&&require;if(!u&&v)return v(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[o]={exports:{}};e[o][0].call(f.exports,function(r){var n=e[o][1][r];return i(n?n:r)},f,f.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)i(t[o]);return i}({1:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isArray=function(r){return null!==r&&r.length>=0&&"[object Array]"===Object.prototype.toString.call(r)},n._pop=function(r){for(var e=[],n=0;n<r.length-1;n++)e[n]=r[n];return e}},{}],2:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ascii={0:["°","₀","۰"],1:["¹","₁","۱"],2:["²","₂","۲"],3:["³","₃","۳"],4:["⁴","₄","۴","٤"],5:["⁵","₅","۵","٥"],6:["⁶","₆","۶","٦"],7:["⁷","₇","۷"],8:["⁸","₈","۸"],9:["⁹","₉","۹"],a:["à","á","ả","ã","ạ","ă","ắ","ằ","ẳ","ẵ","ặ","â","ấ","ầ","ẩ","ẫ","ậ","ā","ą","å","α","ά","ἀ","ἁ","ἂ","ἃ","ἄ","ἅ","ἆ","ἇ","ᾀ","ᾁ","ᾂ","ᾃ","ᾄ","ᾅ","ᾆ","ᾇ","ὰ","ά","ᾰ","ᾱ","ᾲ","ᾳ","ᾴ","ᾶ","ᾷ","а","أ","အ","ာ","ါ","ǻ","ǎ","ª","ა","अ","ا"],b:["б","β","Ъ","Ь","ب","ဗ","ბ"],c:["ç","ć","č","ĉ","ċ"],d:["ď","ð","đ","ƌ","ȡ","ɖ","ɗ","ᵭ","ᶁ","ᶑ","д","δ","د","ض","ဍ","ဒ","დ"],e:["é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ","ë","ē","ę","ě","ĕ","ė","ε","έ","ἐ","ἑ","ἒ","ἓ","ἔ","ἕ","ὲ","έ","е","ё","э","є","ə","ဧ","ေ","ဲ","ე","ए","إ","ئ"],f:["ф","φ","ف","ƒ","ფ"],g:["ĝ","ğ","ġ","ģ","г","ґ","γ","ဂ","გ","گ"],h:["ĥ","ħ","η","ή","ح","ه","ဟ","ှ","ჰ"],i:["í","ì","ỉ","ĩ","ị","î","ï","ī","ĭ","į","ı","ι","ί","ϊ","ΐ","ἰ","ἱ","ἲ","ἳ","ἴ","ἵ","ἶ","ἷ","ὶ","ί","ῐ","ῑ","ῒ","ΐ","ῖ","ῗ","і","ї","и","ဣ","ိ","ီ","ည်","ǐ","ი","इ","ی"],j:["ĵ","ј","Ј","ჯ","ج"],k:["ķ","ĸ","к","κ","Ķ","ق","ك","က","კ","ქ","ک"],l:["ł","ľ","ĺ","ļ","ŀ","л","λ","ل","လ","ლ"],m:["м","μ","م","မ","მ"],n:["ñ","ń","ň","ņ","ʼn","ŋ","ν","н","ن","န","ნ"],o:["ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ","ø","ō","ő","ŏ","ο","ὀ","ὁ","ὂ","ὃ","ὄ","ὅ","ὸ","ό","о","و","θ","ို","ǒ","ǿ","º","ო","ओ"],p:["п","π","ပ","პ","پ"],q:["ყ"],r:["ŕ","ř","ŗ","р","ρ","ر","რ"],s:["ś","š","ş","с","σ","ș","ς","س","ص","စ","ſ","ს"],t:["ť","ţ","т","τ","ț","ت","ط","ဋ","တ","ŧ","თ","ტ"],u:["ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự","û","ū","ů","ű","ŭ","ų","µ","у","ဉ","ု","ူ","ǔ","ǖ","ǘ","ǚ","ǜ","უ","उ"],v:["в","ვ","ϐ"],w:["ŵ","ω","ώ","ဝ","ွ"],x:["χ","ξ"],y:["ý","ỳ","ỷ","ỹ","ỵ","ÿ","ŷ","й","ы","υ","ϋ","ύ","ΰ","ي","ယ"],z:["ź","ž","ż","з","ζ","ز","ဇ","ზ"],aa:["ع","आ","آ"],ae:["ä","æ","ǽ"],ai:["ऐ"],at:["@"],ch:["ч","ჩ","ჭ","چ"],dj:["ђ","đ"],dz:["џ","ძ"],ei:["ऍ"],gh:["غ","ღ"],ii:["ई"],ij:["ij"],kh:["х","خ","ხ"],lj:["љ"],nj:["њ"],oe:["ö","œ","ؤ"],oi:["ऑ"],oii:["ऒ"],ps:["ψ"],sh:["ш","შ","ش"],shch:["щ"],ss:["ß"],sx:["ŝ"],th:["þ","ϑ","ث","ذ","ظ"],ts:["ц","ც","წ"],ue:["ü"],uu:["ऊ"],ya:["я"],yu:["ю"],zh:["ж","ჟ","ژ"],"(c)":["©"],A:["Á","À","Ả","Ã","Ạ","Ă","Ắ","Ằ","Ẳ","Ẵ","Ặ","Â","Ấ","Ầ","Ẩ","Ẫ","Ậ","Å","Ā","Ą","Α","Ά","Ἀ","Ἁ","Ἂ","Ἃ","Ἄ","Ἅ","Ἆ","Ἇ","ᾈ","ᾉ","ᾊ","ᾋ","ᾌ","ᾍ","ᾎ","ᾏ","Ᾰ","Ᾱ","Ὰ","Ά","ᾼ","А","Ǻ","Ǎ"],B:["Б","Β","ब"],C:["Ç","Ć","Č","Ĉ","Ċ"],D:["Ď","Ð","Đ","Ɖ","Ɗ","Ƌ","ᴅ","ᴆ","Д","Δ"],E:["É","È","Ẻ","Ẽ","Ẹ","Ê","Ế","Ề","Ể","Ễ","Ệ","Ë","Ē","Ę","Ě","Ĕ","Ė","Ε","Έ","Ἐ","Ἑ","Ἒ","Ἓ","Ἔ","Ἕ","Έ","Ὲ","Е","Ё","Э","Є","Ə"],F:["Ф","Φ"],G:["Ğ","Ġ","Ģ","Г","Ґ","Γ"],H:["Η","Ή","Ħ"],I:["Í","Ì","Ỉ","Ĩ","Ị","Î","Ï","Ī","Ĭ","Į","İ","Ι","Ί","Ϊ","Ἰ","Ἱ","Ἳ","Ἴ","Ἵ","Ἶ","Ἷ","Ῐ","Ῑ","Ὶ","Ί","И","І","Ї","Ǐ","ϒ"],K:["К","Κ"],L:["Ĺ","Ł","Л","Λ","Ļ","Ľ","Ŀ","ल"],M:["М","Μ"],N:["Ń","Ñ","Ň","Ņ","Ŋ","Н","Ν"],O:["Ó","Ò","Ỏ","Õ","Ọ","Ô","Ố","Ồ","Ổ","Ỗ","Ộ","Ơ","Ớ","Ờ","Ở","Ỡ","Ợ","Ø","Ō","Ő","Ŏ","Ο","Ό","Ὀ","Ὁ","Ὂ","Ὃ","Ὄ","Ὅ","Ὸ","Ό","О","Θ","Ө","Ǒ","Ǿ"],P:["П","Π"],R:["Ř","Ŕ","Р","Ρ","Ŗ"],S:["Ş","Ŝ","Ș","Š","Ś","С","Σ"],T:["Ť","Ţ","Ŧ","Ț","Т","Τ"],U:["Ú","Ù","Ủ","Ũ","Ụ","Ư","Ứ","Ừ","Ử","Ữ","Ự","Û","Ū","Ů","Ű","Ŭ","Ų","У","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ"],V:["В"],W:["Ω","Ώ","Ŵ"],X:["Χ","Ξ"],Y:["Ý","Ỳ","Ỷ","Ỹ","Ỵ","Ÿ","Ῠ","Ῡ","Ὺ","Ύ","Ы","Й","Υ","Ϋ","Ŷ"],Z:["Ź","Ž","Ż","З","Ζ"],AE:["Ä","Æ","Ǽ"],CH:["Ч"],DJ:["Ђ"],DZ:["Џ"],GX:["Ĝ"],HX:["Ĥ"],IJ:["IJ"],JX:["Ĵ"],KH:["Х"],LJ:["Љ"],NJ:["Њ"],OE:["Ö","Œ"],PS:["Ψ"],SH:["Ш"],SHCH:["Щ"],SS:["ẞ"],TH:["Þ"],TS:["Ц"],UE:["Ü"],YA:["Я"],YU:["Ю"],ZH:["Ж"]," ":[" ","â","â","â","â","â","â ","â","â","â","â","â","â¯","â","ã"]}},{}],3:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isNumber=function(r){return"[object Number]"===Object.prototype.toString.call(r)}},{}],4:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.validCharLength=n.validNumber=n.validArrayString=n.validString=void 0;var t=r("../string.utils.js"),i=r("./number"),a=function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return!0};n.validString=a;var o=function(r){return r.map(function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return r}),!0};n.validArrayString=o;var u=function(r){if(!(0,i._isNumber)(r))throw new Error("[strman] "+r+" is not a Number.");return!0};n.validNumber=u;var v=function(r){if(0===(0,t.length)(r))throw new Error("Char should be length >= 1");return!0};n.validCharLength=v},{"../string.utils.js":7,"./number":3}],5:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.slugify=void 0;var t=r("./strman"),i=function(r){var e=r;return e=(0,t.toLowerCase)(e),e=(0,t.trim)(e),e=(0,t.removeSpaces)(e,"-"),e=(0,t.replace)(e,"&","-and-"),e=(0,t.replace)(e,"--+","-"),e=(0,t.removeNonChars)(e),e=(0,t.replace)(e,"[^\\w\\-]+","")};n.slugify=i},{"./strman":8}],6:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(r){return r.toLowerCase()};n.toLowerCase=t;var i=function(r){return r.toUpperCase()};n.toUpperCase=i;var a=function(r){return r===t(r)};n.isLowerCase=a;var o=function(r){return r===i(r)};n.isUpperCase=o;var u=function(r){var e=r.replace(/[\-_\s]+(.)?/g,function(r,e){return e?i(e):""});return i(e.substr(0,1))+e.substr(1)};n.toStudlyCaps=u;var v=function(r){var e=u(r);return t(e.substr(0,1))+e.substr(1)};n.toCamelCase=v;var s=function(r){var e=arguments.length<=1||void 0===arguments[1]?"_":arguments[1],n=v(r),i=n.replace(/([A-Z])+/g,e+"$1");return t(i)};n.toDecamelize=s;var f=function(r){return s(r,"_")};n.toSnakeCase=f;var c=function(r){return s(r,"-")};n.toKebabCase=c},{}],7:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.truncate=n.safeTruncate=n.slice=n.surround=n.shuffle=n.reverse=n.repeat=n.removeRight=n.removeLeft=n.prependArray=n.prepend=n.split=n.substr=n.rightPad=n.leftPad=n.length=n.insert=n.lastIndexOf=n.indexOf=n.last=n.first=n.ensureRight=n.ensureLeft=n.startsWith=n.endsWith=n.countSubstr=n.containsAny=n.containsAll=n.contains=n.includes=n.removeNonWords=n.collapseWhitespace=n.chars=n.between=n.at=n.appendArray=n.append=n.removeNonChars=n.replace=n.removeSpaces=n.rightTrim=n.leftTrim=n.trim=n.isString=void 0;var t=r("./lib/ascii"),i=r("./lib/array"),a=r("./lib/validate"),o=r("./string.cases"),u=function(r){return"[object String]"===Object.prototype.toString.call(r)};n.isString=u;var v=function(r){return s(f(r))};n.trim=v;var s=function(r){return l(r,"^\\s+","")};n.leftTrim=s;var f=function(r){return l(r,"\\s+$","")};n.rightTrim=f;var c=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return l(r,"\\s+",e)};n.removeSpaces=c;var l=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2];return r.replace(new RegExp(e,"g"),n)};n.replace=l;var d=function(r){var e=r;for(var n in t.ascii)for(var i in t.ascii[n])e=l(e,t.ascii[n][i],n);return e};n.removeNonChars=d;var g=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:r+n.join("")};n.append=g;var p=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:r+e.join("")};n.appendArray=p;var h=function(r,e){return(0,a.validString)(r),(0,a.validNumber)(e),R(r,e,1)};n.at=h;var b=function(r,e,n){var t=null;return(0,a.validArrayString)([r,e,n]),t=q(r,n),t=t.map(function(r){return R(r,U(r,e)+W(e))}),t=(0,i._pop)(t)};n.between=b;var y=function(r){var e=[];(0,a.validString)(r);for(var n=0;n<W(r);n++)e[n]=h(r,n);return e};n.chars=y;var m=function(r){return v(l(r,"\\s\\s+"," "))};n.collapseWhitespace=m;var S=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return l(r,"[^\\w]+",e)};n.removeNonWords=S;var j=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return C(r,e,n)};n.includes=j;var C=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return n?U(r,e)>-1:U((0,o.toUpperCase)(r),(0,o.toUpperCase)(e))>-1};n.contains=C;var O=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(!C(r,e[t],n))return!1;return!0};n.containsAll=O;var _=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(C(r,e[t],n))return!0;return!1};n.containsAny=_;var w=function Q(r,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],t=arguments.length<=3||void 0===arguments[3]?0:arguments[3],i=arguments.length<=4||void 0===arguments[4]?0:arguments[4],a=U(r,e,t);return-1===a?i:(n||(a=a+W(e)-1),Q(r,e,n,a+1,i+1))},A=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return n||(r=(0,o.toUpperCase)(r),e=(0,o.toUpperCase)(e)),w(r,e,t)};n.countSubstr=A;var P=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],t=null;return("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>W(r))&&(n=W(r)),n-=W(e),t=U(r,e,n),-1!==t&&t===n};n.endsWith=P;var N=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return R(r,n,W(e))===e};n.startsWith=N;var x=function(r,e){return N(r,e)?r:g(e,r)};n.ensureLeft=x;var L=function(r,e){return P(r,e)?r:g(r,e)};n.ensureRight=L;var E=function(r,e){return R(r,0,e)};n.first=E;var M=function(r,e){return R(r,-1*e,e)};n.last=M;var U=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return r.indexOf(e,n)};n.indexOf=U;var T=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.lastIndexOf(e,n)};n.lastIndexOf=T;var H=function(r,e,n){var t=null,i=null;return n>W(r)?r:(t=R(r,0,n),i=R(r,n,W(r)),g(t,e,i))};n.insert=H;var W=function(r){return r.length};n.length=W;var k=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=R(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=g(Z(n,e),t)};n.leftPad=k;var D=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=R(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=g(t,Z(n,e))};n.rightPad=D;var R=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.substr(e,n)};n.substr=R;var q=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.split(e,n)};n.split=q;var I=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:n.join("")+r};n.prepend=I;var J=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:e.join("")+r};n.prependArray=J;var z=function(r,e){return N(r,e)?R(r,W(e)):r};n.removeLeft=z;var X=function(r,e){var n=W(r)-W(e);return P(r,e)?R(r,0,n):r};n.removeRight=X;var Z=function(r,e){for(var n=0,t="";e>n++;)t+=r;return t};n.repeat=Z;var F=function(r){for(var e=0,n="";W(r)>e++;)n=g(n,R(r,-1*e,1));return n};n.reverse=F;var K=function(r){var e=void 0,n=void 0,t=void 0;for(t=W(r);t;t-=1)e=Math.floor(Math.random()*t),n=r[t-1],r[t-1]=r[e],r[e]=n;return r},Y=function(r){return K(q(r)).join("")};n.shuffle=Y;var G=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return g(e,r,e)};n.surround=G;var $=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.slice(e,n)};n.slice=$;var B=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";if(0===e)return"";if(e>=W(r))return r;if(e===U(r," ",0))return R(r,0,e);e-=W(n),t=R(r,0,e);var i=U(r," ",e-1);if(i!==e){var a=T(t," ",0);t=R(t,0,a)}return g(t,n)};n.safeTruncate=B;var V=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";return 0===e?"":e>=W(r)?r:(e-=W(n),t=R(r,0,e),g(t,n))};n.truncate=V},{"./lib/array":1,"./lib/ascii":2,"./lib/validate":4,"./string.cases":6}],8:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r("./slugify");Object.keys(t).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return t[r]}})});var i=r("./string.utils");Object.keys(i).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return i[r]}})});var a=r("./string.cases");Object.keys(a).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return a[r]}})})},{"./slugify":5,"./string.cases":6,"./string.utils":7}]},{},[8])(8)}); | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e._s=r()}}(function(){return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var v="function"==typeof require&&require;if(!u&&v)return v(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(r){var n=e[o][1][r];return i(n?n:r)},l,l.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)i(t[o]);return i}({1:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isArray=function(r){return null!==r&&r.length>=0&&"[object Array]"===Object.prototype.toString.call(r)},n._pop=function(r){for(var e=[],n=0;n<r.length-1;n++)e[n]=r[n];return e}},{}],2:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ascii={0:["°","₀","۰"],1:["¹","₁","۱"],2:["²","₂","۲"],3:["³","₃","۳"],4:["⁴","₄","۴","٤"],5:["⁵","₅","۵","٥"],6:["⁶","₆","۶","٦"],7:["⁷","₇","۷"],8:["⁸","₈","۸"],9:["⁹","₉","۹"],a:["à","á","ả","ã","ạ","ă","ắ","ằ","ẳ","ẵ","ặ","â","ấ","ầ","ẩ","ẫ","ậ","ā","ą","å","α","ά","ἀ","ἁ","ἂ","ἃ","ἄ","ἅ","ἆ","ἇ","ᾀ","ᾁ","ᾂ","ᾃ","ᾄ","ᾅ","ᾆ","ᾇ","ὰ","ά","ᾰ","ᾱ","ᾲ","ᾳ","ᾴ","ᾶ","ᾷ","а","أ","အ","ာ","ါ","ǻ","ǎ","ª","ა","अ","ا"],b:["б","β","Ъ","Ь","ب","ဗ","ბ"],c:["ç","ć","č","ĉ","ċ"],d:["ď","ð","đ","ƌ","ȡ","ɖ","ɗ","ᵭ","ᶁ","ᶑ","д","δ","د","ض","ဍ","ဒ","დ"],e:["é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ","ë","ē","ę","ě","ĕ","ė","ε","έ","ἐ","ἑ","ἒ","ἓ","ἔ","ἕ","ὲ","έ","е","ё","э","є","ə","ဧ","ေ","ဲ","ე","ए","إ","ئ"],f:["ф","φ","ف","ƒ","ფ"],g:["ĝ","ğ","ġ","ģ","г","ґ","γ","ဂ","გ","گ"],h:["ĥ","ħ","η","ή","ح","ه","ဟ","ှ","ჰ"],i:["í","ì","ỉ","ĩ","ị","î","ï","ī","ĭ","į","ı","ι","ί","ϊ","ΐ","ἰ","ἱ","ἲ","ἳ","ἴ","ἵ","ἶ","ἷ","ὶ","ί","ῐ","ῑ","ῒ","ΐ","ῖ","ῗ","і","ї","и","ဣ","ိ","ီ","ည်","ǐ","ი","इ","ی"],j:["ĵ","ј","Ј","ჯ","ج"],k:["ķ","ĸ","к","κ","Ķ","ق","ك","က","კ","ქ","ک"],l:["ł","ľ","ĺ","ļ","ŀ","л","λ","ل","လ","ლ"],m:["м","μ","م","မ","მ"],n:["ñ","ń","ň","ņ","ʼn","ŋ","ν","н","ن","န","ნ"],o:["ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ","ø","ō","ő","ŏ","ο","ὀ","ὁ","ὂ","ὃ","ὄ","ὅ","ὸ","ό","о","و","θ","ို","ǒ","ǿ","º","ო","ओ"],p:["п","π","ပ","პ","پ"],q:["ყ"],r:["ŕ","ř","ŗ","р","ρ","ر","რ"],s:["ś","š","ş","с","σ","ș","ς","س","ص","စ","ſ","ს"],t:["ť","ţ","т","τ","ț","ت","ط","ဋ","တ","ŧ","თ","ტ"],u:["ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự","û","ū","ů","ű","ŭ","ų","µ","у","ဉ","ု","ူ","ǔ","ǖ","ǘ","ǚ","ǜ","უ","उ"],v:["в","ვ","ϐ"],w:["ŵ","ω","ώ","ဝ","ွ"],x:["χ","ξ"],y:["ý","ỳ","ỷ","ỹ","ỵ","ÿ","ŷ","й","ы","υ","ϋ","ύ","ΰ","ي","ယ"],z:["ź","ž","ż","з","ζ","ز","ဇ","ზ"],aa:["ع","आ","آ"],ae:["ä","æ","ǽ"],ai:["ऐ"],at:["@"],ch:["ч","ჩ","ჭ","چ"],dj:["ђ","đ"],dz:["џ","ძ"],ei:["ऍ"],gh:["غ","ღ"],ii:["ई"],ij:["ij"],kh:["х","خ","ხ"],lj:["љ"],nj:["њ"],oe:["ö","œ","ؤ"],oi:["ऑ"],oii:["ऒ"],ps:["ψ"],sh:["ш","შ","ش"],shch:["щ"],ss:["ß"],sx:["ŝ"],th:["þ","ϑ","ث","ذ","ظ"],ts:["ц","ც","წ"],ue:["ü"],uu:["ऊ"],ya:["я"],yu:["ю"],zh:["ж","ჟ","ژ"],"(c)":["©"],A:["Á","À","Ả","Ã","Ạ","Ă","Ắ","Ằ","Ẳ","Ẵ","Ặ","Â","Ấ","Ầ","Ẩ","Ẫ","Ậ","Å","Ā","Ą","Α","Ά","Ἀ","Ἁ","Ἂ","Ἃ","Ἄ","Ἅ","Ἆ","Ἇ","ᾈ","ᾉ","ᾊ","ᾋ","ᾌ","ᾍ","ᾎ","ᾏ","Ᾰ","Ᾱ","Ὰ","Ά","ᾼ","А","Ǻ","Ǎ"],B:["Б","Β","ब"],C:["Ç","Ć","Č","Ĉ","Ċ"],D:["Ď","Ð","Đ","Ɖ","Ɗ","Ƌ","ᴅ","ᴆ","Д","Δ"],E:["É","È","Ẻ","Ẽ","Ẹ","Ê","Ế","Ề","Ể","Ễ","Ệ","Ë","Ē","Ę","Ě","Ĕ","Ė","Ε","Έ","Ἐ","Ἑ","Ἒ","Ἓ","Ἔ","Ἕ","Έ","Ὲ","Е","Ё","Э","Є","Ə"],F:["Ф","Φ"],G:["Ğ","Ġ","Ģ","Г","Ґ","Γ"],H:["Η","Ή","Ħ"],I:["Í","Ì","Ỉ","Ĩ","Ị","Î","Ï","Ī","Ĭ","Į","İ","Ι","Ί","Ϊ","Ἰ","Ἱ","Ἳ","Ἴ","Ἵ","Ἶ","Ἷ","Ῐ","Ῑ","Ὶ","Ί","И","І","Ї","Ǐ","ϒ"],K:["К","Κ"],L:["Ĺ","Ł","Л","Λ","Ļ","Ľ","Ŀ","ल"],M:["М","Μ"],N:["Ń","Ñ","Ň","Ņ","Ŋ","Н","Ν"],O:["Ó","Ò","Ỏ","Õ","Ọ","Ô","Ố","Ồ","Ổ","Ỗ","Ộ","Ơ","Ớ","Ờ","Ở","Ỡ","Ợ","Ø","Ō","Ő","Ŏ","Ο","Ό","Ὀ","Ὁ","Ὂ","Ὃ","Ὄ","Ὅ","Ὸ","Ό","О","Θ","Ө","Ǒ","Ǿ"],P:["П","Π"],R:["Ř","Ŕ","Р","Ρ","Ŗ"],S:["Ş","Ŝ","Ș","Š","Ś","С","Σ"],T:["Ť","Ţ","Ŧ","Ț","Т","Τ"],U:["Ú","Ù","Ủ","Ũ","Ụ","Ư","Ứ","Ừ","Ử","Ữ","Ự","Û","Ū","Ů","Ű","Ŭ","Ų","У","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ"],V:["В"],W:["Ω","Ώ","Ŵ"],X:["Χ","Ξ"],Y:["Ý","Ỳ","Ỷ","Ỹ","Ỵ","Ÿ","Ῠ","Ῡ","Ὺ","Ύ","Ы","Й","Υ","Ϋ","Ŷ"],Z:["Ź","Ž","Ż","З","Ζ"],AE:["Ä","Æ","Ǽ"],CH:["Ч"],DJ:["Ђ"],DZ:["Џ"],GX:["Ĝ"],HX:["Ĥ"],IJ:["IJ"],JX:["Ĵ"],KH:["Х"],LJ:["Љ"],NJ:["Њ"],OE:["Ö","Œ"],PS:["Ψ"],SH:["Ш"],SHCH:["Щ"],SS:["ẞ"],TH:["Þ"],TS:["Ц"],UE:["Ü"],YA:["Я"],YU:["Ю"],ZH:["Ж"]," ":[" ","â","â","â","â","â","â ","â","â","â","â","â","â¯","â","ã"]}},{}],3:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isNumber=function(r){return"[object Number]"===Object.prototype.toString.call(r)}},{}],4:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.validCharLength=n.validNumber=n.validArrayString=n.validString=void 0;var t=r("../string.utils.js"),i=r("./number"),a=function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return!0};n.validString=a;var o=function(r){return r.map(function(r){if(!(0,t.isString)(r))throw new Error("[strman] "+r+" is not a String.");return r}),!0};n.validArrayString=o;var u=function(r){if(!(0,i._isNumber)(r))throw new Error("[strman] "+r+" is not a Number.");return!0};n.validNumber=u;var v=function(r){if(0===(0,t.length)(r))throw new Error("Char should be length >= 1");return!0};n.validCharLength=v},{"../string.utils.js":7,"./number":3}],5:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.slugify=void 0;var t=r("./strman"),i=function(r){var e=r;return e=(0,t.toLowerCase)(e),e=(0,t.trim)(e),e=(0,t.removeSpaces)(e,"-"),e=(0,t.replace)(e,"&","-and-"),e=(0,t.transliterate)(e),e=(0,t.replace)(e,"[^\\w\\-]+",""),e=(0,t.replace)(e,"--+","-")};n.slugify=i},{"./strman":8}],6:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(r){return r.toLowerCase()};n.toLowerCase=t;var i=function(r){return r.toUpperCase()};n.toUpperCase=i;var a=function(r){return r===t(r)};n.isLowerCase=a;var o=function(r){return r===i(r)};n.isUpperCase=o;var u=function(r){var e=r.replace(/[\-_\s]+(.)?/g,function(r,e){return e?i(e):""});return i(e.substr(0,1))+e.substr(1)};n.toStudlyCaps=u;var v=function(r){var e=u(r);return t(e.substr(0,1))+e.substr(1)};n.toCamelCase=v;var s=function(r){var e=arguments.length<=1||void 0===arguments[1]?"_":arguments[1],n=v(r),i=n.replace(/([A-Z])+/g,e+"$1");return t(i)};n.toDecamelize=s;var l=function(r){return s(r,"_")};n.toSnakeCase=l;var f=function(r){return s(r,"-")};n.toKebabCase=f},{}],7:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.truncate=n.safeTruncate=n.slice=n.surround=n.shuffle=n.reverse=n.repeat=n.removeRight=n.removeLeft=n.prependArray=n.prepend=n.split=n.substr=n.rightPad=n.leftPad=n.length=n.insert=n.lastIndexOf=n.indexOf=n.last=n.first=n.ensureRight=n.ensureLeft=n.startsWith=n.endsWith=n.countSubstr=n.containsAny=n.containsAll=n.contains=n.removeNonWords=n.collapseWhitespace=n.chars=n.between=n.at=n.appendArray=n.append=n.removeNonChars=n.transliterate=n.replace=n.removeSpaces=n.rightTrim=n.leftTrim=n.trim=n.isString=void 0;var t=r("./lib/ascii"),i=r("./lib/array"),a=r("./lib/validate"),o=r("./string.cases"),u=function(r){return"[object String]"===Object.prototype.toString.call(r)};n.isString=u;var v=function(r){return s(l(r))};n.trim=v;var s=function(r){return c(r,"^\\s+","")};n.leftTrim=s;var l=function(r){return c(r,"\\s+$","")};n.rightTrim=l;var f=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return c(r,"\\s+",e)};n.removeSpaces=f;var c=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.replace(new RegExp(e,"g"),n):r.replace(new RegExp(e,"ig"),n)};n.replace=c;var d=function(r){var e=r;for(var n in t.ascii)for(var i in t.ascii[n])e=c(e,t.ascii[n][i],n);return e};n.transliterate=d;var g=d;n.removeNonChars=g;var p=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:r+n.join("")};n.append=p;var h=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:r+e.join("")};n.appendArray=h;var b=function(r,e){return(0,a.validString)(r),(0,a.validNumber)(e),D(r,e,1)};n.at=b;var y=function(r,e,n){var t=null;return(0,a.validArrayString)([r,e,n]),t=I(r,n),t=t.map(function(r){return D(r,M(r,e)+W(e))}),t=(0,i._pop)(t)};n.between=y;var m=function(r){var e=[];(0,a.validString)(r);for(var n=0;n<W(r);n++)e[n]=b(r,n);return e};n.chars=m;var S=function(r){return v(c(r,"\\s\\s+"," "))};n.collapseWhitespace=S;var C=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return c(r,"[^\\w]+",e)};n.removeNonWords=C;var j=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return n?M(r,e)>-1:M((0,o.toUpperCase)(r),(0,o.toUpperCase)(e))>-1};n.contains=j;var O=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(!j(r,e[t],n))return!1;return!0};n.containsAll=O;var _=function(r,e){for(var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=0;t<W(e);t++)if(j(r,e[t],n))return!0;return!1};n.containsAny=_;var w=function Q(r,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],t=arguments.length<=3||void 0===arguments[3]?0:arguments[3],i=arguments.length<=4||void 0===arguments[4]?0:arguments[4],a=M(r,e,t);return-1===a?i:(n||(a=a+W(e)-1),Q(r,e,n,a+1,i+1))},A=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];return n||(r=(0,o.toUpperCase)(r),e=(0,o.toUpperCase)(e)),w(r,e,t)};n.countSubstr=A;var U=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3],i=null;return("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>W(r))&&(n=W(r)),n-=W(e),i=t?M(r,e,n):M((0,o.toUpperCase)(r),(0,o.toUpperCase)(e),n),-1!==i&&i===n};n.endsWith=U;var x=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?D(r,n,W(e))===e:D((0,o.toUpperCase)(r),n,W(e))===(0,o.toUpperCase)(e)};n.startsWith=x;var P=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return x(r,e,0,n)?r:p(e,r)};n.ensureLeft=P;var E=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return U(r,e,null,n)?r:p(r,e)};n.ensureRight=E;var L=function(r,e){return D(r,0,e)};n.first=L;var N=function(r,e){return D(r,-1*e,e)};n.last=N;var M=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.indexOf(e,n):(0,o.toUpperCase)(r).indexOf((0,o.toUpperCase)(e),n)};n.indexOf=M;var T=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2],t=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];return t?r.lastIndexOf(e,n):(0,o.toUpperCase)(r).lastIndexOf((0,o.toUpperCase)(e),n)};n.lastIndexOf=T;var H=function(r,e,n){var t=null,i=null;return n>W(r)?r:(t=D(r,0,n),i=D(r,n,W(r)),p(t,e,i))};n.insert=H;var W=function(r){return r.length};n.length=W;var R=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=D(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=p(Z(n,e),t)};n.leftPad=R;var k=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?" ":arguments[2],t=r;return n=String(n),W(n)>1&&(n=D(n,0,1)),(0,a.validCharLength)(n),e-=W(r),t=p(t,Z(n,e))};n.rightPad=k;var D=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.substr(e,n)};n.substr=D;var I=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.split(e,n)};n.split=I;var q=function(r){for(var e=arguments.length,n=Array(e>1?e-1:0),t=1;e>t;t++)n[t-1]=arguments[t];return(0,a.validString)(r),(0,a.validArrayString)(n),0===W(n)?r:n.join("")+r};n.prepend=q;var J=function(r){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return(0,a.validString)(r),(0,a.validArrayString)(e),0===W(e)?r:e.join("")+r};n.prependArray=J;var z=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return x(r,e,0,n)?D(r,W(e)):r};n.removeLeft=z;var X=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],t=W(r)-W(e);return U(r,e,null,n)?D(r,0,t):r};n.removeRight=X;var Z=function(r,e){for(var n=0,t="";e>n++;)t+=r;return t};n.repeat=Z;var F=function(r){for(var e=0,n="";W(r)>e++;)n=p(n,D(r,-1*e,1));return n};n.reverse=F;var K=function(r){var e=void 0,n=void 0,t=void 0;for(t=W(r);t;t-=1)e=Math.floor(Math.random()*t),n=r[t-1],r[t-1]=r[e],r[e]=n;return r},Y=function(r){return K(I(r)).join("")};n.shuffle=Y;var G=function(r){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return p(e,r,e)};n.surround=G;var $=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?void 0:arguments[2];return r.slice(e,n)};n.slice=$;var B=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";if(0===e)return"";if(e>=W(r))return r;if(e===M(r," ",0))return D(r,0,e);e-=W(n),t=D(r,0,e);var i=M(r," ",e-1);if(i!==e){var a=T(t," ",0);t=D(t,0,a)}return p(t,n)};n.safeTruncate=B;var V=function(r,e){var n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],t="";return 0===e?"":e>=W(r)?r:(e-=W(n),t=D(r,0,e),p(t,n))};n.truncate=V},{"./lib/array":1,"./lib/ascii":2,"./lib/validate":4,"./string.cases":6}],8:[function(r,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r("./slugify");Object.keys(t).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return t[r]}})});var i=r("./string.utils");Object.keys(i).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return i[r]}})});var a=r("./string.cases");Object.keys(a).forEach(function(r){"default"!==r&&Object.defineProperty(n,r,{enumerable:!0,get:function(){return a[r]}})})},{"./slugify":5,"./string.cases":6,"./string.utils":7}]},{},[8])(8)}); |
@@ -5,3 +5,3 @@ <p align="center"> | ||
![build](https://travis-ci.org/dleitee/strman.svg?branch=master) | ||
[![Build Status](https://travis-ci.org/dleitee/strman.svg?branch=master)](https://travis-ci.org/dleitee/strman) | ||
@@ -22,2 +22,6 @@ A Javascript string manipulation library without npm dependences. | ||
## Credits | ||
- [Stringy](https://github.com/danielstjules/Stringy) | ||
## Usage | ||
@@ -70,7 +74,7 @@ | ||
- [x] [countSubstr](https://github.com/dleitee/strman#countsubstrvalue-substr-casesensitive--true-allowoverlapping--false) | ||
- [x] [endsWith](https://github.com/dleitee/strman#endswithvalue-search-positionnull) | ||
- [x] [ensureLeft](https://github.com/dleitee/strman#ensureleftvalue-substr) | ||
- [x] [ensureRight](https://github.com/dleitee/strman#ensurerightvalue-substr) | ||
- [x] [endsWith](https://github.com/dleitee/strman#endswithvalue-search-positionnull-casesensitivetrue) | ||
- [x] [ensureLeft](https://github.com/dleitee/strman#ensureleftvalue-substr-casesensitivetrue) | ||
- [x] [ensureRight](https://github.com/dleitee/strman#ensurerightvalue-substr-casesensitivetrue) | ||
- [x] [first](https://github.com/dleitee/strman#firstvalue-n) | ||
- [x] [indexOf](https://github.com/dleitee/strman#indexofvalue-needle-offset--0) | ||
- [x] [indexOf](https://github.com/dleitee/strman#indexofvalue-needle-offset--0-casesensitivetrue) | ||
- [x] [insert](https://github.com/dleitee/strman#insertvalue-substr-index) | ||
@@ -81,3 +85,3 @@ - [x] [isLowerCase](https://github.com/dleitee/strman#islowercasevalue-n) | ||
- [x] [last](https://github.com/dleitee/strman#lastvalue-n) | ||
- [x] [lastIndexOf](https://github.com/dleitee/strman#lastindexofvalue-needle-offset--0) | ||
- [x] [lastIndexOf](https://github.com/dleitee/strman#lastindexofvalue-needle-offset--0-casesensitivetrue) | ||
- [x] [leftPad](https://github.com/dleitee/strman#leftpadvalue-length-char) | ||
@@ -88,9 +92,9 @@ - [x] [leftTrim](https://github.com/dleitee/strman#lefttrimvalue) | ||
- [x] [prependArray](https://github.com/dleitee/strman#prependarrayvalue-prepend--) | ||
- [x] [removeLeft](https://github.com/dleitee/strman#removeleftvalue-prefix) | ||
- [x] [removeLeft](https://github.com/dleitee/strman#removeleftvalue-prefix-casesensitivetrue) | ||
- [x] [removeNonChars](https://github.com/dleitee/strman#removenoncharsvalue) | ||
- [x] [removeNonWords](https://github.com/dleitee/strman#removenonwordsvalue-replace) | ||
- [x] [removeRight](https://github.com/dleitee/strman#removerightvalue-suffix) | ||
- [x] [removeRight](https://github.com/dleitee/strman#removerightvalue-suffix-casesensitivetrue) | ||
- [x] [removeSpaces](https://github.com/dleitee/strman#removespacesvalue-replace) | ||
- [x] [repeat](https://github.com/dleitee/strman#repeatvalue-multiplier) | ||
- [x] [replace](https://github.com/dleitee/strman#replacevalue-search-newvalue) | ||
- [x] [replace](https://github.com/dleitee/strman#replacevalue-search-newvalue-casesensitivetrue) | ||
- [x] [reverse](https://github.com/dleitee/strman#reversevalue) | ||
@@ -453,3 +457,3 @@ - [x] [rightPad](https://github.com/dleitee/strman#rightpadvalue-length-char) | ||
## removeNonChars([value]) | ||
`@deprecated use transliterate` | ||
Remove all non valid characters. | ||
@@ -742,2 +746,14 @@ | ||
## transliterate([value]) | ||
Remove all non valid characters. | ||
```es6 | ||
import {removeNonChars} from 'strman' | ||
let title = "áéíóú"; | ||
let result = removeNonChars(title); | ||
// result => "aeiou"; | ||
``` | ||
## trim([value]) | ||
@@ -744,0 +760,0 @@ |
@@ -0,1 +1,5 @@ | ||
/* | ||
* Credits for: @danielstjules | ||
* https://github.com/danielstjules/Stringy/blob/master/src/Stringy.php#L1601-L1756 | ||
*/ | ||
export const ascii = { | ||
@@ -2,0 +6,0 @@ '0': ['°', '₀', '۰'], |
@@ -1,2 +0,2 @@ | ||
import {toLowerCase, trim, removeSpaces, replace, removeNonChars} from './strman'; | ||
import {toLowerCase, trim, removeSpaces, replace, transliterate} from './strman'; | ||
@@ -16,5 +16,5 @@ /* | ||
result = replace(result, '&','-and-'); | ||
result = transliterate(result); | ||
result = replace(result, '[^\\w\\-]+', ''); | ||
result = replace(result, '\-\-+','-'); | ||
result = removeNonChars(result); | ||
result = replace(result, '[^\\w\\-]+', ''); | ||
@@ -21,0 +21,0 @@ return result; |
@@ -77,3 +77,3 @@ import {ascii} from './lib/ascii'; | ||
*/ | ||
const removeNonChars = (value) => { | ||
const transliterate = (value) => { | ||
let result = value; | ||
@@ -88,2 +88,13 @@ for(let key in ascii){ | ||
export {transliterate}; | ||
/* | ||
* @deprecated Since version 1.0.1. Will be deleted in version 1.2.0. Use transliterate instead. | ||
* Remove all non valid characters | ||
* Example: change á => a or ẽ => e | ||
* @params value - The string being searched and replaced on. | ||
* @return String without non valid characters. | ||
*/ | ||
const removeNonChars = transliterate; | ||
export {removeNonChars}; | ||
@@ -90,0 +101,0 @@ |
@@ -14,2 +14,4 @@ import chai from 'chai'; | ||
'fóõ bár', | ||
'foo ! bar', | ||
'foo ~~ bar', | ||
'foo bar', | ||
@@ -16,0 +18,0 @@ 'FOO bar' |
@@ -6,3 +6,3 @@ import chai from 'chai'; | ||
length, leftPad, rightPad, prepend, removeLeft, appendArray, prependArray, removeRight, | ||
repeat, reverse, shuffle, surround, safeTruncate, truncate} | ||
repeat, reverse, shuffle, surround, safeTruncate, transliterate, truncate} | ||
from '../src/strman'; | ||
@@ -129,2 +129,14 @@ | ||
describe('transliterate function', () => { | ||
it('should be foo bar', () => { | ||
let fixtures = [ | ||
'fóõ bár' | ||
]; | ||
fixtures.forEach(el => { | ||
chai.expect(transliterate(el)).to.equal('foo bar'); | ||
}); | ||
}); | ||
}); | ||
describe('append function', () => { | ||
@@ -131,0 +143,0 @@ it('should be foobar', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137867
27
1868
801