Comparing version 1.0.0 to 1.1.0
@@ -10,3 +10,3 @@ # arrays.fill | ||
<h3 id="fillarray-value-start0-end"><code>fill(array, value, [start=0], [end])</code></h3> | ||
<h3 id="fillarray-value-start0-endarraylength"><code>fill(array, value, [start=0], [end=array.length])</code></h3> | ||
@@ -19,3 +19,3 @@ Fills items in an array with a specified value. Optionally, one can start and/or end from a specific index. | ||
3. `[start=0]` *(number)*: start index | ||
4. `[end]` *(number)*: end index | ||
4. `[end=array.length]` *(number)*: end index | ||
@@ -22,0 +22,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # arrays.find | ||
<h3 id="findarray-predicate-thisargundefined"><code>find(array, predicate, [thisArg=undefined])</code></h3> | ||
<h3 id="findarray-predicate-thisarg"><code>find(array, predicate, [thisArg])</code></h3> | ||
@@ -19,3 +19,3 @@ Find method returns the value of first element at which a provided function is true, | ||
2. `predicate` *(Function)*: to be run against each element of the array | ||
3. `[thisArg=undefined]` *(*)*: this argument in the function | ||
3. `[thisArg]` *(*)*: this argument in the function | ||
@@ -22,0 +22,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # arrays.findIndex | ||
<h3 id="findindexarray-predicate-thisargundefined"><code>findIndex(array, predicate, [thisArg=undefined])</code></h3> | ||
<h3 id="findindexarray-predicate-thisarg"><code>findIndex(array, predicate, [thisArg])</code></h3> | ||
@@ -19,3 +19,3 @@ FindIndex method returns the value of First element at which a provided function is true, | ||
2. `predicate` *(Function)*: to be run against each element of the array | ||
3. `[thisArg=undefined]` *(*)*: this argument in the function | ||
3. `[thisArg]` *(*)*: this argument in the function | ||
@@ -22,0 +22,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # arrays.findLastIndex | ||
<h3 id="findlastindexarray-predicate-thisargundefined"><code>findLastIndex(array, predicate, [thisArg=undefined])</code></h3> | ||
<h3 id="findlastindexarray-predicate-thisarg"><code>findLastIndex(array, predicate, [thisArg])</code></h3> | ||
@@ -19,3 +19,3 @@ FindLastIndex method returns the value of Last element at which a provided function is true, | ||
2. `predicate` *(Function)*: to be run against each element of the array | ||
3. `[thisArg=undefined]` *(*)*: this argument in the function | ||
3. `[thisArg]` *(*)*: this argument in the function | ||
@@ -22,0 +22,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # arrays.map | ||
<h3 id="maparray-func"><code>map(array, [func])</code></h3> | ||
<h3 id="maparray-func"><code>map(array, func)</code></h3> | ||
@@ -17,3 +17,3 @@ Map iterates over an array of values and applies a function to each value | ||
1. `array` *(Array)*: input array | ||
2. `[func]` *(Function)*: function describing how to map values | ||
2. `func` *(Function)*: function describing how to map values | ||
@@ -20,0 +20,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # objects.filter | ||
<h3 id="filterobject-filter"><code>filter(object, [filter])</code></h3> | ||
<h3 id="filterobject-predicate"><code>filter(object, predicate)</code></h3> | ||
@@ -19,3 +19,3 @@ Filter iterates over an object and applies a predicate to each property, for all properties | ||
1. `object` *(Object)*: input object | ||
2. `[filter]` *(Function)*: predicate function to check what properties to include | ||
2. `predicate` *(Function)*: predicate function to check what properties to include | ||
@@ -22,0 +22,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # objects.findKey | ||
<h3 id="findkeyobject-predicate-thisarg"><code>findKey(object, [predicate], [thisArg])</code></h3> | ||
<h3 id="findkeyobject-predicatex-thisarg"><code>findKey(object, [predicate=(x)], [thisArg])</code></h3> | ||
@@ -17,3 +17,3 @@ FindKey returns the key of the first property value for which a supplied function returns true | ||
1. `object` *(object)*: input object | ||
2. `[predicate]` *(function)*: function to test against object values | ||
2. `[predicate=(x)]` *(function)*: function to test against object values | ||
3. `[thisArg]` *(*)*: value of this in a function call | ||
@@ -20,0 +20,0 @@ |
@@ -10,3 +10,3 @@ # objects.findLastKey | ||
<h3 id="findlastkeyobject-predicate-thisarg"><code>findLastKey(object, [predicate], [thisArg])</code></h3> | ||
<h3 id="findlastkeyobject-predicatex-thisarg"><code>findLastKey(object, [predicate=(x)], [thisArg])</code></h3> | ||
@@ -17,3 +17,3 @@ FindLastKey returns the key of the last property value for which a supplied function returns true | ||
1. `object` *(object)*: input object | ||
2. `[predicate]` *(function)*: function to test against object values | ||
2. `[predicate=(x)]` *(function)*: function to test against object values | ||
3. `[thisArg]` *(*)*: value of this in a function call | ||
@@ -20,0 +20,0 @@ |
@@ -10,3 +10,3 @@ # objects.transform | ||
<h3 id="transformobject-func-accumulator"><code>transform(object, [func], [accumulator={}])</code></h3> | ||
<h3 id="transformobject-func-accumulator"><code>transform(object, func, [accumulator={}])</code></h3> | ||
@@ -17,3 +17,3 @@ Transform works like reduce, except the accumulator is implicitly returned | ||
1. `object` *(object)*: input object | ||
2. `[func]` *(function)*: iteratee function | ||
2. `func` *(function)*: iteratee function | ||
3. `[accumulator={}]` *(Array|object)*: custom accumulator object | ||
@@ -20,0 +20,0 @@ |
@@ -10,3 +10,3 @@ # strings.camelCase | ||
<h3 id="camelcasestring"><code>camelCase([string=''])</code></h3> | ||
<h3 id="camelcasestring"><code>camelCase([string])</code></h3> | ||
@@ -16,3 +16,3 @@ camelCase updates a string to camelcase | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
@@ -19,0 +19,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # strings.deburr | ||
<h3 id="deburrstring"><code>deburr([string=''])</code></h3> | ||
<h3 id="deburrstring"><code>deburr([string])</code></h3> | ||
@@ -16,3 +16,3 @@ Deburrs string by converting all complex Latin characters to basic Latin letters in a string. | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
@@ -19,0 +19,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # strings.kebabCase | ||
<h3 id="kebabcasestring"><code>kebabCase([string=''])</code></h3> | ||
<h3 id="kebabcasestring"><code>kebabCase([string])</code></h3> | ||
@@ -16,3 +16,3 @@ kebabCase updates a string to kebabcase | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
@@ -19,0 +19,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # strings.pascalCase | ||
<h3 id="pascalcasestring"><code>pascalCase([string=''])</code></h3> | ||
<h3 id="pascalcasestring"><code>pascalCase([string])</code></h3> | ||
@@ -16,3 +16,3 @@ pascalCase updates a string to pascalCase | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
@@ -19,0 +19,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # strings.snakeCase | ||
<h3 id="snakecasestring"><code>snakeCase([string=''])</code></h3> | ||
<h3 id="snakecasestring"><code>snakeCase([string])</code></h3> | ||
@@ -16,3 +16,3 @@ snakeCase updates a string to snakecase | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
@@ -19,0 +19,0 @@ #### Returns |
@@ -10,3 +10,3 @@ # strings.trimEnd | ||
<h3 id="trimendstring-chars"><code>trimEnd([string=''], [chars=' '])</code></h3> | ||
<h3 id="trimendstring-chars"><code>trimEnd([string], [chars=' '])</code></h3> | ||
@@ -16,3 +16,3 @@ TrimEnd trims any whitespace or the selected characters from the end of the string | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
2. `[chars=' ']` *(string)*: characters to remove from end of the string | ||
@@ -19,0 +19,0 @@ |
@@ -10,3 +10,3 @@ # strings.trimStart | ||
<h3 id="trimstartstring-chars"><code>trimStart([string=''], [chars=' '])</code></h3> | ||
<h3 id="trimstartstring-chars"><code>trimStart([string], [chars=' '])</code></h3> | ||
@@ -16,3 +16,3 @@ TrimStart trims any whitespace or the selected characters from the beginning of the string | ||
#### Arguments | ||
1. `[string='']` *(string)*: input string | ||
1. `[string]` *(string)*: input string | ||
2. `[chars=' ']` *(string)*: characters to remove from beginning of string | ||
@@ -19,0 +19,0 @@ |
@@ -10,3 +10,3 @@ # strings.truncate | ||
<h3 id="truncatestring-options"><code>truncate([string=''], [options={}])</code></h3> | ||
<h3 id="truncatestring-options"><code>truncate([string], [options={}])</code></h3> | ||
@@ -17,3 +17,3 @@ Truncates string if it's longer than the given maximum string length. The last characters | ||
#### Arguments | ||
1. `[string='']` *(string)*: string to truncate | ||
1. `[string]` *(string)*: string to truncate | ||
2. `[options={}]` *(Object)*: object containing options | ||
@@ -20,0 +20,0 @@ 3. `[options.length=30]` *(number)*: Max length of truncated string |
@@ -10,3 +10,3 @@ # strings.words | ||
<h3 id="wordsstring-pattern"><code>words([string=''], [pattern])</code></h3> | ||
<h3 id="wordsstring-pattern"><code>words([string], [pattern])</code></h3> | ||
@@ -16,3 +16,3 @@ Splits `string` into an array of its words. | ||
#### Arguments | ||
1. `[string='']` *(string)*: string to inspect for words | ||
1. `[string]` *(string)*: string to inspect for words | ||
2. `[pattern]` *(RegExp|string)*: regex pattern to match words or string of characters to split words by. | ||
@@ -19,0 +19,0 @@ |
@@ -1,1 +0,1 @@ | ||
var e=Object.freeze({__proto__:null,chunk:function(e,t=1){let r=[];return e.reduce((e,n,u,c)=>(r.push(n),r.length===t&&(e.push(r),r=[]),r.length>0&&u===c.length-1&&e.push(r),e),[])},compact:function(e){return e.reduce((e,t)=>(t&&e.push(t),e),[])},difference:function(e,t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},drop:function(e,t=1){return e.reduce((e,r)=>t>0?(t--,e):(e.push(r),e),[])},dropRight:function(e,t=1){return e.reduce((e,r,n,u)=>t>0?(t--,e):(e.unshift(u[u.length-n-1]),e),[])},fill:function(e,t,r=0,n){return n||(n=e.length-1),e.reduce((e,u,c)=>(c>=r&&c<=n?e.push(t):e.push(u),e),[])},filter:function(e,t){return e.reduce((e,r)=>(t(r)&&e.push(r),e),[])},find:function(e,t,r){if(0!==e.length){if(null==this)throw TypeError('"this" is null or not defined');if("function"!=typeof t)throw TypeError("predicate must be a function");if(t.call(r,e[0]))return e[0];if(1!==e.length)return e.reduce((e,n,u)=>1===u?t.call(r,n)?n:void 0:!e&&t.call(r,n)?n:e)}},findIndex:function(e,t,r){if(0===e.length)return-1;if(null==this)throw TypeError('"this" is null or not defined');if("function"!=typeof t)throw TypeError("predicate must be a function");return e.reduce((e,n,u)=>e<0&&t.call(r,n)?u:e,-1)},findLastIndex:function(e,t,r){if(0===e.length)return-1;if(null==this)throw TypeError('"this" is null or not defined');if("function"!=typeof t)throw TypeError("predicate must be a function");return t.call(r,e[e.length-1])?e.length-1:1===e.length?-1:e.reduceRight((n,u,c)=>c===e.length-2?t.call(r,u)?c:-1:n<0&&t.call(r,u)?c:n)},flat:function e(t,r=1){return t.reduce((t,n)=>(Array.isArray(n)&&r>0?t.push(...e(n,r-1)):t.push(n),t),[])},frequency:function(e){return e.reduce((e,t)=>(e[t]=e[t]?++e[t]:1,e),{})},intersection:function(...e){return[...new Set(arguments[0])].reduce((t,r)=>(e.slice(1).reduce((e,t,n)=>!(e&&!new Set(t).has(r))&&e,!0)&&t.push(r),t),[])},map:function(e,t){return t?e.reduce((e,r)=>(e.push(t(r)),e),[]):e},pull:function(e,...t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},takeRight:function(e,t=1){const r=e.length-1-t;return e.reduce((e,t,n)=>(n>r&&e.push(t),e),[])},take:function(e,t=1){return e.reduce((e,r,n)=>(n<t&&e.push(r),e),[])},union:function(...e){return Array.from([...e].reduce((e,t)=>(Array.isArray(t)&&t.reduce((t,r)=>(e.add(r),t),""),e),new Set))},unique:function(e){return[...e.reduce((e,t)=>(e.add(t),e),new Set)]},unzip:function(e){const t=new Array(e.reduce((e,t)=>t.length>e?t.length:e,0)).fill(void 0);return e.reduce((r,n,u)=>(t.reduce((t,n,c)=>(r[c]=r[c]||[],r[c].push(e[u][c]),null),null),r),[])},without:function(e,...t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},xor:function(...e){if(e.length<2)return 0===e.length?[]:e[0];const t=new Set,r=e.reduce((e,r)=>(r.reduce((t,r)=>(e.has(r)&&t.push(r),t),[]).forEach(e=>t.add(e)),r.forEach(t=>e.add(t)),e),new Set);return t.forEach(e=>r.delete(e)),[...r]},zip:function(e,t,r=((e,t)=>[e,t])){if(r&&"function"!=typeof r)throw TypeError("func must be a function");return e.length<=t.length?e.reduce((e,n,u)=>(e[u]=r(n,t[u]),e),[]):t.reduce((t,n,u)=>(t[u]=r(e[u],n),t),[])}});const t=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\u1ab0-\u1aff\u1dc0-\u1dff]/g,r="ÀÁÂÃÄÅàáâãäåÇçÐðÈÉÊËèéêëÌÍÎÏìíîïÑñÒÓÔÕÖØòóôõöøÙÚÛÜùúûüÝýÿÆæÞþßĀĂĄāăąĆĈĊČćĉċčĎĐďđĒĔĖĘĚēĕėęěĜĞĠĢĝğġģĤĦĥħĨĪĬĮİĩīĭįıĴĵĶķĸĹĻĽĿŁĺļľŀłŃŅŇŊńņňŋŌŎŐōŏőŔŖŘŕŗřŚŜŞŠśŝşšŢŤŦţťŧŨŪŬŮŰŲũūŭůűųŴŵŶŷŸŹŻŽźżžIJijŒœʼnſ",n=new RegExp("["+r+"]|[^"+r+"]+","g"),u={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};const c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o=`[${c}]`,i="[\\u2700-\\u27bf]",f="[a-z\\xdf-\\xf6\\xf8-\\xff]",l=`[^\\ud800-\\udfff${c+"\\d\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde"}]`,s="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",a="[A-Z\\xc0-\\xd6\\xd8-\\xde]",p=`(?:${f}|${l})`,h=`(?:${a}|${l})`,y="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",g="[\\ufe0e\\ufe0f]?"+y+`(?:\\u200d(?:${["[^\\ud800-\\udfff]",s,d].join("|")})${"[\\ufe0e\\ufe0f]?"+y})*`,b=`(?:${[i,s,d].join("|")})${g}`,O=RegExp([`${a}?${f}+(?:['’](?:d|ll|m|re|s|t|ve))?(?=${[o,a,"$"].join("|")})`,`${h}+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=${[o,a+p,"$"].join("|")})`,`${a}?${p}+(?:['’](?:d|ll|m|re|s|t|ve))?`,`${a}+(?:['’](?:D|LL|M|RE|S|T|VE))?`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",b].join("|"),"g");var j=Object.freeze({__proto__:null,camelCase:function(e=""){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>(t&&r.length>0?(r=r.toLowerCase(),t=!1):r=r.charAt(0).toUpperCase()+r.slice(1).toLowerCase(),e+r),"")},chomp:function(e,t){const r=e.split("");let n=!1;if(void 0===t)return r.reduceRight((e,t,u)=>{if(u===r.length-1){if("\n"===t)return n=!0,e;if("\r"===t)return e}else if(n&&u===r.length-2&&"\r"===t)return e;return t+e},"");if(""===t){let e=!0;return r.reduceRight((t,r,u)=>{if(e&&n&&"\r"===r)return n=!1,t;if(e){if("\n"===r)return n=!0,t;if("\r"===r)return e=!1,r+t}return r+t},"")}{const e=r.length-t.length;let n=!0,u="";return r.reduce((c,o,i)=>i>=e?(u+=o,o!==t[i-e]&&(n=!1),i===r.length-1?n?c:c+u:c):c+o,"")}},deburr:function(e){let r="";const c=e.match(n);return r=c?c.reduce((e,t)=>1===t.length&&Object.prototype.hasOwnProperty.call(u,t)?e+u[t]:e+t,""):e,r.replace(t,"")},endsWith:function(e,t=""){return e.split("").reduce((e,r,n,u)=>u[u.length-n-1]!==t[t.length-n-1]?(u=u.splice(0),!1):n===t.length-1?(u=u.splice(0),!0):e,null)},includes:function(e,t,r=0){if(0===e.length)return!1;const n=t.length,u=t.charAt(0);return 0===r&&e.substring(0,n)===t||e.split("").reduce((c,o,i)=>{if(i>=r){if(c)return c;if(o===u)return e.substring(i,i+n)===t}return!1},!1)},kebabCase:function(e=""){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>r.length>0?t?(t=!1,r.toLowerCase()):e+"-"+r.toLowerCase():e,"")},pad:function(e,t=0,r=" "){const n=e.length,u=t-n>0?Math.ceil((t-n)/2):0;return e.padStart(t-u,r).padEnd(t,r)},padEnd:function(e,t=0,r=" "){let n=e.length;const u=t-e.length>0?t-e.length:0;let c=0;return[...e,...Array(u)].reduce((e,t)=>0!==n?(e.push(t),n--,e):(e.push(r[c]),c=c+1<r.length?c+1:0,e),[]).join("")},padStart:function(e,t=0,r=" "){let n=t-e.length>0?t-e.length:0,u=0;return[...Array(n),...e].reduce((e,t)=>0!==n?(e.push(r[u]),u=u+1<r.length?u+1:0,n--,e):(e.push(t),e),[]).join("")},pascalCase:function(e=""){return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,t)=>e+t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),"")},repeat:function(e,t=0){return 0===e.length||t<1?"":new Array(t).fill("").reduce(t=>t+e,"")},reverse:function(e){return e.split("").reduce((e,t)=>t+e,"")},snakeCase:function(e=""){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>r.length>0?t?(t=!1,r.toLowerCase()):e+"_"+r.toLowerCase():e,"")},startsWith:function(e,t){let r=e.split("");return r.reduce((e,n,u,c)=>n!==t[u]?(r=c.splice(0),!1):u===t.length-1?(r=c.splice(0),!0):e,null)},trimStart:function(e="",t=" "){const r=new Set([...t]);let n=!0;return[...e].reduce((e,t)=>n?r.has(t)?e:(n=!1,e+t):e+t,"")},trimEnd:function(e="",t=" "){const r=new Set([...t]);let n=!0;return[...e].reduceRight((e,t)=>n?r.has(t)?e:(n=!1,t+e):t+e,"")},truncate:function(e="",t){let r,n=30,u="...";if(t&&(void 0!==t.length&&(n=t.length),void 0!==t.omission&&(u=t.omission),void 0!==t.separator&&(r=t.separator)),n>=e.length)return e;const c=n-u.length;if(c<1)return u;let o,i,f=e.slice(0,c);if(void 0===r)return f+u;if("string"==typeof r?o=r:i=r,i){if(e.slice(c).search(i)){let e,t;const r=f;for(i.global||(i=RegExp(i.source,i.flags+"g")),i.lastIndex=0,e=i.exec(r);e;)t=e.index,e=i.exec(r);f=f.slice(0,void 0===t?c:t)}}else if(e.indexOf(o,c)!==c){const e=f.lastIndexOf(o);e>-1&&(f=f.slice(0,e))}return f+u},words:function(e,t){return void 0===t?e.match(O)||[]:"string"==typeof t?e.match(new RegExp("[^"+t+"]+","g"))||[]:e.match(t)||[]}});const v=(e,t)=>Array.isArray(t)?Array.isArray(e)?A(e,t):e:w(e,t),A=(e,t)=>{const r=[...e];return t.reduce((t,n,u)=>(void 0===e[u]?r[u]=n:"object"==typeof n&&(r[u]=v(e[u],n)),null),null),r},w=(e,t)=>{const r={};return"object"!=typeof e?e:(Object.keys(e).reduce((t,n)=>(void 0===r[n]&&(r[n]=e[n]),null),null),Object.keys(t).reduce((n,u)=>("object"==typeof t[u]&&e[u]?r[u]=v(e[u],t[u]):void 0===r[u]&&(r[u]=t[u]),null),null),r)};const x=(e,t)=>typeof e==typeof t&&("object"!=typeof e?e===t:Object.keys(t).reduce((r,n)=>{if(r)return r;if(Object.prototype.hasOwnProperty.call(e,n)!==Object.prototype.hasOwnProperty.call(t,n))return!1;if("object"==typeof e[n]){if(!x(e[n],t[n]))return!1}else if("function"==typeof e[n]){if(void 0===t[n]||String(e[n])!==String(t[n]))return!1}else if(e[n]!==t[n])return!1;return!0},!1));const E=(e,t)=>typeof e==typeof t&&("object"!=typeof e?e===t:Object.keys(t).reduceRight((r,n)=>{if(r)return r;if(Object.prototype.hasOwnProperty.call(e,n)!==Object.prototype.hasOwnProperty.call(t,n))return!1;if("object"==typeof e[n]){if(!E(e[n],t[n]))return!1}else if("function"==typeof e[n]){if(void 0===t[n]||String(e[n])!==String(t[n]))return!1}else if(e[n]!==t[n])return!1;return!0},!1));const S=(e,t)=>Array.isArray(t)?Array.isArray(e)?k(e,t):t:m(e,t),k=(e,t)=>{const r=e.slice();return t.reduce((t,n,u)=>(void 0===r[u]?r[u]=n:"object"==typeof n?r[u]=S(e[u],n):-1===e.indexOf(n)&&r.push(n),null),null),r},m=(e,t)=>{const r={};return"object"==typeof e&&Object.keys(e).reduce((t,n)=>(r[n]=e[n],null),null),Object.keys(t).reduce((n,u)=>("object"==typeof t[u]&&e[u]?r[u]=S(e[u],t[u]):r[u]=t[u],null),null),r};var $=Object.freeze({__proto__:null,assign:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>(Object.keys(t).reduce((r,n)=>(e[n]=t[n],null),null),e),{})},at:function(e,...t){if(0===t.length)return[];const r=[],n=e=>{e.reduce((e,t,n)=>(r[n]=String(t).replace(/\[(\w+)\]/g,".$1").split("."),null),null)};return Array.isArray(t[0])?n(t[0]):n(t),r.reduce((t,r)=>{const n=r.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e);return t.push(n),t},[])},defaults:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>(Object.keys(t).reduce((r,n)=>(void 0===e[n]&&(e[n]=t[n]),null),null),e),{})},defaultsDeep:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>v(e,t))},entries:function(e){return Object.keys(e).reduce((t,r)=>(t.push([r,e[r]]),t),[])},filter:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>(!0===t(e[n],n,e)&&(r[n]=e[n]),r),{})},findKey:function(e,t=(e=>e),r){const n=Object.keys(e);return"function"==typeof t?n.reduce((n,u)=>n||(t.call(r,e[u])?u:n),void 0):Array.isArray(t)?n.reduce((r,n)=>r||(e[n][t[0]]===t[1]?n:r),void 0):"object"==typeof t?n.reduce((r,n)=>r||(x(e[n],t)?n:r),void 0):n.reduce((r,n)=>r||(e[n][t]?n:r),void 0)},findLastKey:function(e,t=(e=>e),r){const n=Object.keys(e);return"function"==typeof t?n.reduceRight((n,u)=>n||(t.call(r,e[u])?u:n),void 0):Array.isArray(t)?n.reduceRight((r,n)=>r||(e[n][t[0]]===t[1]?n:r),void 0):"object"==typeof t?n.reduceRight((r,n)=>r||(E(e[n],t)?n:r),void 0):n.reduceRight((r,n)=>r||(e[n][t]?n:r),void 0)},forIn:function(e,t){const r=Object.getPrototypeOf(e),n=r?Object.keys(r):[];return Object.keys(e).reduce((r,n)=>(t(e[n],n,e),null),null),n.reduce((n,u)=>(t(r[u],u,e),null),null),e},fromEntries:function(e){return e.reduce((e,t)=>(e[t[0]]=t[1],e),{})},has:function(e,t){if(void 0===t)return!1;let r;return r=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split("."),void 0!==r.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e)},get:function(e,t,r){if(void 0===t)return;let n;n=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split(".");const u=n.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e);return void 0!==u?u:r},invert:function(e){return Object.keys(e).reduce((t,r)=>(t[e[r]]=r,t),{})},mapKeys:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>({...r,[t(e[n],n,e)]:e[n]}),{})},mapValues:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n],n,e)}),{})},merge:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>S(e,t))},pick:function(e,...t){if(0===t.length)return{};const r=new Set;return Array.isArray(t[0])?t[0].forEach(e=>r.add(String(e))):t.forEach(e=>r.add(String(e))),Object.keys(e).reduce((t,n)=>(r.has(n)&&(t[n]=e[n]),t),{})},result:function(e,t,r){if(void 0===t)return;let n;n=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split(".");const u=n.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?"function"==typeof e[t]?e[t]():e[t]:void 0},e);return void 0!==u?u:"function"==typeof r?r():r},transform:function(e,t,r={}){return void 0===t?e:Object.keys(e).reduce((r,n)=>(t(r,e[n],n,e),r),r)},values:function(e){return Object.keys(e).reduce((t,r)=>(t.push(e[r]),t),[])}});export{e as arrays,$ as objects,j as strings}; | ||
var e=Object.freeze({__proto__:null,chunk:function(e,t=1){let r=[];return e.reduce((e,n,u,c)=>(r.push(n),r.length===t&&(e.push(r),r=[]),r.length>0&&u===c.length-1&&e.push(r),e),[])},compact:function(e){return e.reduce((e,t)=>(t&&e.push(t),e),[])},difference:function(e,t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},drop:function(e,t=1){return e.reduce((e,r)=>t>0?(t--,e):(e.push(r),e),[])},dropRight:function(e,t=1){return e.reduce((e,r,n,u)=>t>0?(t--,e):(e.unshift(u[u.length-n-1]),e),[])},fill:function(e,t,r=0,n=e.length-1){return e.reduce((e,u,c)=>(c>=r&&c<=n?e.push(t):e.push(u),e),[])},filter:function(e,t){return e.reduce((e,r)=>(t(r)&&e.push(r),e),[])},find:function(e,t,r){if(0!==e.length){if("function"!=typeof t)throw TypeError("predicate must be a function");if(t.call(r,e[0]))return e[0];if(1!==e.length)return e.reduce((e,n,u)=>1===u?t.call(r,n)?n:void 0:!e&&t.call(r,n)?n:e)}},findIndex:function(e,t,r){if(0===e.length)return-1;if("function"!=typeof t)throw TypeError("predicate must be a function");return e.reduce((e,n,u)=>e<0&&t.call(r,n)?u:e,-1)},findLastIndex:function(e,t,r){if(0===e.length)return-1;if("function"!=typeof t)throw TypeError("predicate must be a function");return t.call(r,e[e.length-1])?e.length-1:1===e.length?-1:e.reduceRight((n,u,c)=>c===e.length-2?t.call(r,u)?c:-1:n<0&&t.call(r,u)?c:n)},flat:function e(t,r=1){return t.reduce((t,n)=>(Array.isArray(n)&&r>0?t.push(...e(n,r-1)):t.push(n),t),[])},frequency:function(e){return e.reduce((e,t)=>(e[t]=e[t]?++e[t]:1,e),{})},intersection:function(...e){return[...new Set(arguments[0])].reduce((t,r)=>(e.slice(1).reduce((e,t,n)=>!(e&&!new Set(t).has(r))&&e,!0)&&t.push(r),t),[])},map:function(e,t){return t?e.reduce((e,r)=>(e.push(t(r)),e),[]):e},pull:function(e,...t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},takeRight:function(e,t=1){const r=e.length-1-t;return e.reduce((e,t,n)=>(n>r&&e.push(t),e),[])},take:function(e,t=1){return e.reduce((e,r,n)=>(n<t&&e.push(r),e),[])},union:function(...e){return Array.from([...e].reduce((e,t)=>(Array.isArray(t)&&t.reduce((t,r)=>(e.add(r),t),""),e),new Set))},unique:function(e){return[...e.reduce((e,t)=>(e.add(t),e),new Set)]},unzip:function(e){const t=new Array(e.reduce((e,t)=>t.length>e?t.length:e,0)).fill(void 0);return e.reduce((r,n,u)=>(t.reduce((t,n,c)=>(r[c]=r[c]||[],r[c].push(e[u][c]),null),null),r),[])},without:function(e,...t){const r=new Set(t);return e.reduce((e,t)=>(r.has(t)||e.push(t),e),[])},xor:function(...e){if(e.length<2)return 0===e.length?[]:e[0];const t=new Set,r=e.reduce((e,r)=>(r.reduce((t,r)=>(e.has(r)&&t.push(r),t),[]).forEach(e=>t.add(e)),r.forEach(t=>e.add(t)),e),new Set);return t.forEach(e=>r.delete(e)),[...r]},zip:function(e,t,r=((e,t)=>[e,t])){if(r&&"function"!=typeof r)throw TypeError("func must be a function");return e.length<=t.length?e.reduce((e,n,u)=>(e[u]=r(n,t[u]),e),[]):t.reduce((t,n,u)=>(t[u]=r(e[u],n),t),[])}});const t=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\u1ab0-\u1aff\u1dc0-\u1dff]/g,r="ÀÁÂÃÄÅàáâãäåÇçÐðÈÉÊËèéêëÌÍÎÏìíîïÑñÒÓÔÕÖØòóôõöøÙÚÛÜùúûüÝýÿÆæÞþßĀĂĄāăąĆĈĊČćĉċčĎĐďđĒĔĖĘĚēĕėęěĜĞĠĢĝğġģĤĦĥħĨĪĬĮİĩīĭįıĴĵĶķĸĹĻĽĿŁĺļľŀłŃŅŇŊńņňŋŌŎŐōŏőŔŖŘŕŗřŚŜŞŠśŝşšŢŤŦţťŧŨŪŬŮŰŲũūŭůűųŴŵŶŷŸŹŻŽźżžIJijŒœʼnſ",n=new RegExp("["+r+"]|[^"+r+"]+","g"),u={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};const c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o=`[${c}]`,i="[\\u2700-\\u27bf]",f="[a-z\\xdf-\\xf6\\xf8-\\xff]",l=`[^\\ud800-\\udfff${c+"\\d\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde"}]`,s="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",a="[A-Z\\xc0-\\xd6\\xd8-\\xde]",p=`(?:${f}|${l})`,h=`(?:${a}|${l})`,y="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",g="[\\ufe0e\\ufe0f]?"+y+`(?:\\u200d(?:${["[^\\ud800-\\udfff]",s,d].join("|")})${"[\\ufe0e\\ufe0f]?"+y})*`,b=`(?:${[i,s,d].join("|")})${g}`,O=RegExp([`${a}?${f}+(?:['’](?:d|ll|m|re|s|t|ve))?(?=${[o,a,"$"].join("|")})`,`${h}+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=${[o,a+p,"$"].join("|")})`,`${a}?${p}+(?:['’](?:d|ll|m|re|s|t|ve))?`,`${a}+(?:['’](?:D|LL|M|RE|S|T|VE))?`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",b].join("|"),"g");var j=Object.freeze({__proto__:null,camelCase:function(e){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>(t&&r.length>0?(r=r.toLowerCase(),t=!1):r=r.charAt(0).toUpperCase()+r.slice(1).toLowerCase(),e+r),"")},chomp:function(e,t){const r=e.split("");let n=!1;if(void 0===t)return r.reduceRight((e,t,u)=>{if(u===r.length-1){if("\n"===t)return n=!0,e;if("\r"===t)return e}else if(n&&u===r.length-2&&"\r"===t)return e;return t+e},"");if(""===t){let e=!0;return r.reduceRight((t,r,u)=>{if(e&&n&&"\r"===r)return n=!1,t;if(e){if("\n"===r)return n=!0,t;if("\r"===r)return e=!1,r+t}return r+t},"")}{const e=r.length-t.length;let n=!0,u="";return r.reduce((c,o,i)=>i>=e?(u+=o,o!==t[i-e]&&(n=!1),i===r.length-1?n?c:c+u:c):c+o,"")}},deburr:function(e){let r="";const c=e.match(n);return r=c?c.reduce((e,t)=>1===t.length&&Object.prototype.hasOwnProperty.call(u,t)?e+u[t]:e+t,""):e,r.replace(t,"")},endsWith:function(e,t=""){return e.split("").reduce((e,r,n,u)=>u[u.length-n-1]!==t[t.length-n-1]?(u=u.splice(0),!1):n===t.length-1?(u=u.splice(0),!0):e,null)},includes:function(e,t,r=0){if(0===e.length)return!1;const n=t.length,u=t.charAt(0);return 0===r&&e.substring(0,n)===t||e.split("").reduce((c,o,i)=>{if(i>=r){if(c)return c;if(o===u)return e.substring(i,i+n)===t}return!1},!1)},kebabCase:function(e){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>r.length>0?t?(t=!1,r.toLowerCase()):e+"-"+r.toLowerCase():e,"")},pad:function(e,t=0,r=" "){const n=e.length,u=t-n>0?Math.ceil((t-n)/2):0;return e.padStart(t-u,r).padEnd(t,r)},padEnd:function(e,t=0,r=" "){let n=e.length;const u=t-e.length>0?t-e.length:0;let c=0;return[...e,...Array(u)].reduce((e,t)=>0!==n?(e.push(t),n--,e):(e.push(r[c]),c=c+1<r.length?c+1:0,e),[]).join("")},padStart:function(e,t=0,r=" "){let n=t-e.length>0?t-e.length:0,u=0;return[...Array(n),...e].reduce((e,t)=>0!==n?(e.push(r[u]),u=u+1<r.length?u+1:0,n--,e):(e.push(t),e),[]).join("")},pascalCase:function(e){return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,t)=>e+t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),"")},repeat:function(e,t=0){return 0===e.length||t<1?"":new Array(t).fill("").reduce(t=>t+e,"")},reverse:function(e){return e.split("").reduce((e,t)=>t+e,"")},snakeCase:function(e){let t=!0;return e.replace(/[\u2019']/,"").split(/[\u002D\u2014\-_\s]+/).reduce((e,r)=>r.length>0?t?(t=!1,r.toLowerCase()):e+"_"+r.toLowerCase():e,"")},startsWith:function(e,t){let r=e.split("");return r.reduce((e,n,u,c)=>n!==t[u]?(r=c.splice(0),!1):u===t.length-1?(r=c.splice(0),!0):e,null)},trimStart:function(e,t=" "){const r=new Set([...t]);let n=!0;return[...e].reduce((e,t)=>n?r.has(t)?e:(n=!1,e+t):e+t,"")},trimEnd:function(e,t=" "){const r=new Set([...t]);let n=!0;return[...e].reduceRight((e,t)=>n?r.has(t)?e:(n=!1,t+e):t+e,"")},truncate:function(e,t){let r,n=30,u="...";if(t&&(void 0!==t.length&&(n=t.length),void 0!==t.omission&&(u=t.omission),void 0!==t.separator&&(r=t.separator)),n>=e.length)return e;const c=n-u.length;if(c<1)return u;let o,i,f=e.slice(0,c);if(void 0===r)return f+u;if("string"==typeof r?o=r:i=r,i){if(e.slice(c).search(i)){let e,t;const r=f;for(i.global||(i=RegExp(i.source,i.flags+"g")),i.lastIndex=0,e=i.exec(r);e;)t=e.index,e=i.exec(r);f=f.slice(0,void 0===t?c:t)}}else if(e.indexOf(o,c)!==c){const e=f.lastIndexOf(o);e>-1&&(f=f.slice(0,e))}return f+u},words:function(e,t){return void 0===t?e.match(O)||[]:"string"==typeof t?e.match(new RegExp("[^"+t+"]+","g"))||[]:e.match(t)||[]}});const v=(e,t)=>Array.isArray(t)?Array.isArray(e)?A(e,t):e:x(e,t),A=(e,t)=>{const r=[...e];return t.reduce((t,n,u)=>(void 0===e[u]?r[u]=n:"object"==typeof n&&(r[u]=v(e[u],n)),null),null),r},x=(e,t)=>{const r={};return"object"!=typeof e?e:(Object.keys(e).reduce((t,n)=>(void 0===r[n]&&(r[n]=e[n]),null),null),Object.keys(t).reduce((n,u)=>("object"==typeof t[u]&&e[u]?r[u]=v(e[u],t[u]):void 0===r[u]&&(r[u]=t[u]),null),null),r)};const w=(e,t)=>typeof e==typeof t&&("object"!=typeof e?e===t:Object.keys(t).reduce((r,n)=>{if(r)return r;if(Object.prototype.hasOwnProperty.call(e,n)!==Object.prototype.hasOwnProperty.call(t,n))return!1;if("object"==typeof e[n]){if(!w(e[n],t[n]))return!1}else if("function"==typeof e[n]){if(void 0===t[n]||String(e[n])!==String(t[n]))return!1}else if(e[n]!==t[n])return!1;return!0},!1));const S=(e,t)=>typeof e==typeof t&&("object"!=typeof e?e===t:Object.keys(t).reduceRight((r,n)=>{if(r)return r;if(Object.prototype.hasOwnProperty.call(e,n)!==Object.prototype.hasOwnProperty.call(t,n))return!1;if("object"==typeof e[n]){if(!S(e[n],t[n]))return!1}else if("function"==typeof e[n]){if(void 0===t[n]||String(e[n])!==String(t[n]))return!1}else if(e[n]!==t[n])return!1;return!0},!1));const E=(e,t)=>Array.isArray(t)?Array.isArray(e)?k(e,t):t:m(e,t),k=(e,t)=>{const r=e.slice();return t.reduce((t,n,u)=>(void 0===r[u]?r[u]=n:"object"==typeof n?r[u]=E(e[u],n):-1===e.indexOf(n)&&r.push(n),null),null),r},m=(e,t)=>{const r={};return"object"==typeof e&&Object.keys(e).reduce((t,n)=>(r[n]=e[n],null),null),Object.keys(t).reduce((n,u)=>("object"==typeof t[u]&&e[u]?r[u]=E(e[u],t[u]):r[u]=t[u],null),null),r};var $=Object.freeze({__proto__:null,assign:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>(Object.keys(t).reduce((r,n)=>(e[n]=t[n],null),null),e),{})},at:function(e,...t){if(0===t.length)return[];const r=[],n=e=>{e.reduce((e,t,n)=>(r[n]=String(t).replace(/\[(\w+)\]/g,".$1").split("."),null),null)};return Array.isArray(t[0])?n(t[0]):n(t),r.reduce((t,r)=>{const n=r.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e);return t.push(n),t},[])},defaults:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>(Object.keys(t).reduce((r,n)=>(void 0===e[n]&&(e[n]=t[n]),null),null),e),{})},defaultsDeep:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>v(e,t))},entries:function(e){return Object.keys(e).reduce((t,r)=>(t.push([r,e[r]]),t),[])},filter:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>(!0===t(e[n],n,e)&&(r[n]=e[n]),r),{})},findKey:function(e,t=(e=>e),r){const n=Object.keys(e);return"function"==typeof t?n.reduce((n,u)=>n||(t.call(r,e[u])?u:n),void 0):Array.isArray(t)?n.reduce((r,n)=>r||(e[n][t[0]]===t[1]?n:r),void 0):"object"==typeof t?n.reduce((r,n)=>r||(w(e[n],t)?n:r),void 0):n.reduce((r,n)=>r||(e[n][t]?n:r),void 0)},findLastKey:function(e,t=(e=>e),r){const n=Object.keys(e);return"function"==typeof t?n.reduceRight((n,u)=>n||(t.call(r,e[u])?u:n),void 0):Array.isArray(t)?n.reduceRight((r,n)=>r||(e[n][t[0]]===t[1]?n:r),void 0):"object"==typeof t?n.reduceRight((r,n)=>r||(S(e[n],t)?n:r),void 0):n.reduceRight((r,n)=>r||(e[n][t]?n:r),void 0)},forIn:function(e,t){const r=Object.getPrototypeOf(e),n=r?Object.keys(r):[];return Object.keys(e).reduce((r,n)=>(t(e[n],n,e),null),null),n.reduce((n,u)=>(t(r[u],u,e),null),null),e},fromEntries:function(e){return e.reduce((e,t)=>(e[t[0]]=t[1],e),{})},has:function(e,t){if(void 0===t)return!1;let r;return r=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split("."),void 0!==r.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e)},get:function(e,t,r){if(void 0===t)return;let n;n=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split(".");const u=n.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},e);return void 0!==u?u:r},invert:function(e){return Object.keys(e).reduce((t,r)=>(t[e[r]]=r,t),{})},mapKeys:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>({...r,[t(e[n],n,e)]:e[n]}),{})},mapValues:function(e,t){return"function"!=typeof t?e:Object.keys(e).reduce((r,n)=>({...r,[n]:t(e[n],n,e)}),{})},merge:function(e,...t){if(arguments.length<2)return 1===arguments.length?e:{};const r=[e,...t];return r.reduce((e,t)=>E(e,t))},pick:function(e,...t){if(0===t.length)return{};const r=new Set;return Array.isArray(t[0])?t[0].forEach(e=>r.add(String(e))):t.forEach(e=>r.add(String(e))),Object.keys(e).reduce((t,n)=>(r.has(n)&&(t[n]=e[n]),t),{})},result:function(e,t,r){if(void 0===t)return;let n;n=Array.isArray(t)?t:String(t).replace(/\[(\w+)\]/g,".$1").split(".");const u=n.reduce((e,t)=>{if(void 0!==e)return Object.prototype.hasOwnProperty.call(e,t)?"function"==typeof e[t]?e[t]():e[t]:void 0},e);return void 0!==u?u:"function"==typeof r?r():r},transform:function(e,t,r={}){return void 0===t?e:Object.keys(e).reduce((r,n)=>(t(r,e[n],n,e),r),r)},values:function(e){return Object.keys(e).reduce((t,r)=>(t.push(e[r]),t),[])}});export{e as arrays,$ as objects,j as strings}; |
{ | ||
"name": "absurdum", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Reductio Ad Absurdum - The Ridiculous Application of Reduce", | ||
@@ -16,3 +16,3 @@ "keywords": [ | ||
"email": "evan.plaice@gmail.com", | ||
"url": "http://evanplaice.com" | ||
"url": "https://evanplaice.com" | ||
}, | ||
@@ -27,5 +27,19 @@ { | ||
"license": "MIT", | ||
"main": "index.js", | ||
"module": "dist/absurdum.cjs", | ||
"type": "module", | ||
"main": "index.cjs", | ||
"exports": { | ||
".": { | ||
"import": "./index.js", | ||
"require": "./index.cjs" | ||
}, | ||
"./arrays": { | ||
"import": "./src/arrays/index.js" | ||
}, | ||
"./objects": { | ||
"import": "./src/objects/index.js" | ||
}, | ||
"./strings": { | ||
"import": "./src/strings/index.js" | ||
} | ||
}, | ||
"types": "index.d.ts", | ||
@@ -35,2 +49,3 @@ "scripts": { | ||
"test:watch": "tape-watch-es", | ||
"test:compat": "node src/compat.spec.cjs", | ||
"lint": "semistandard", | ||
@@ -48,3 +63,3 @@ "types": "npx tsc -p .config/jsconfig.json", | ||
"package": "npx rimraf package && npm pack | tail -n 1 | xargs tar -xf", | ||
"preversion": "npm test && npm run lint && npm run types", | ||
"preversion": "npm test && npm run test:compat && npm run lint && npm run types", | ||
"postversion": "git push --follow-tags" | ||
@@ -61,2 +76,5 @@ }, | ||
}, | ||
"engines": { | ||
"node": ">=13.7" | ||
}, | ||
"semistandard": { | ||
@@ -63,0 +81,0 @@ "ignore": [ |
@@ -7,2 +7,4 @@ [](https://github.com/vanillaes/absurdum/releases) | ||
<div style="font-weight:bold; text-align:center;">⚠️ Notice: Node users, this library relies heavily on features that are still marked 'experimental' in Node ⚠️</div> | ||
Absurdum is a Javascript utility library built with a focus on providing idempotent side-effect free functions and clear/readable modular source for tree shaking. | ||
@@ -12,19 +14,69 @@ | ||
- Exploration of the flexibility of Reduce | ||
- Source of functions is viewable in one file | ||
- CommonJS and ES2015 module support | ||
- All functions are side-effect free | ||
- Polyfills for older environments | ||
- Executes on VanillaJS data structures | ||
- Small footprint (15K minified) | ||
- Explores the flexibility of Reduce | ||
- Abstraction Free -> tree-shake friendly | ||
- Functional -> all operators are side-effect free | ||
- Polyfills -> includes operator polyfills for older browsers | ||
- Modern -> works transparently with ESM *and* CJS | ||
- Typescript -> typings are provided for all operators | ||
- Intellisense -> supports code completions + inline documentation | ||
- Well Tested -> includes 600+ tests covering every aspect | ||
- Small Footprint -> 15K minified | ||
## Imports | ||
This package provides a variety of entry-points for all JS platforms | ||
### Browsers | ||
All top-level operator namespaces (ie `[arrays, objects, strings]`) can be imported from the index | ||
```javascript | ||
import { arrays, objects, strings } from 'path/to/absurdum/index.js'; | ||
``` | ||
The minified version can be imported from | ||
```javascript | ||
import { arrays, objects, strings } from 'path/to/absurdum/index.min.js'; | ||
``` | ||
### Node/Bundlers (ESM) | ||
Top-level ES module namespaces are provided for Node/Bundlers | ||
```javascript | ||
import { arrays, objects, strings } from 'absurdum'; | ||
``` | ||
Individual operators can be imported from their parent namespaces | ||
```javascript | ||
import { chunk, find } from 'absurdum/arrays'; | ||
import { assign, invert } from 'absurdum/objects'; | ||
import { camelCase, repeat } from 'absurdum/strings'; | ||
``` | ||
*Note: Webpack's tree-shaking algorithm doesn't handle multi-layered exports. To optimize bundle size, prefer individual operator imports.* | ||
### Node/Legacy (CJS) | ||
For Node users who rely on CommonJS, top-level namespaces are provided | ||
```javascript | ||
const arrays = require('absurdum').arrays; | ||
const objects = require('absurdum').objects; | ||
const strings = require('absurdum').strings; | ||
``` | ||
*Note: CJS entry-points are backward-compatible with all non-EOL versions of Node* | ||
## Usage | ||
Import the desired namespace then call the operator from it | ||
Import an operator and feed it some inputs | ||
```javascript | ||
import { arrays } from 'absurdum'; | ||
import { reverse } from 'absurdum/arrays'; | ||
const input = ['a', 'b', 'c', 'd']; | ||
const output = arrays.reverse(input); | ||
const output = reverse(input); | ||
console.log(output); | ||
@@ -34,10 +86,4 @@ // > ['d', 'c', 'b', 'a'] | ||
## CommonJS | ||
*Tip: For VSCode users. Input type-checking, intellisense, and inline documentation are all supported.* | ||
A CommonJS bundle is included for backward compatibility with `node <= 13.2` | ||
```javascript | ||
const absurdum = require('absurdum/index.cjs'); | ||
``` | ||
## API Documentation | ||
@@ -264,7 +310,1 @@ | ||
[String.prototype.trimStart]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart | ||
[Array.prototype.reduce]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | ||
[wikipedia]: https://en.wikipedia.org/wiki/Reductio_ad_absurdum | ||
[operator]: https://github.com/evanplaice/absurdum/issues/new?title=Operator([operator])&template=OPERATOR_TEMPLATE.md&labels=enhancement,operator | ||
[type]: https://github.com/evanplaice/absurdum/issues/new?title=Type([typ])&template=TYPE_TEMPLATE.md&labels=enhancement,type | ||
[feature-workflow]:https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow |
@@ -7,3 +7,3 @@ /** | ||
* @param {number} [start=0] start index | ||
* @param {number} [end] end index | ||
* @param {number} [end=array.length] end index | ||
* @returns {Array} input array filled w/ the value | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ /** | ||
* @param {number} [start=0] start index | ||
* @param {number} [end] end index | ||
* @param {number} [end=array.length] end index | ||
* @returns {Array} input array filled w/ the value | ||
@@ -16,6 +16,3 @@ * | ||
*/ | ||
function fill (array, value, start = 0, end) { | ||
if (!end) { | ||
end = array.length - 1; | ||
} | ||
function fill (array, value, start = 0, end = array.length - 1) { | ||
return array.reduce((acc, curr, idx) => { | ||
@@ -22,0 +19,0 @@ if (idx >= start && idx <= end) { |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -20,5 +20,4 @@ * | ||
*/ | ||
function find (array, predicate, thisArg = undefined) { | ||
function find (array, predicate, thisArg) { | ||
if (array.length === 0) return undefined; | ||
if (this == null) { throw TypeError('"this" is null or not defined'); } | ||
if (typeof predicate !== 'function') { throw TypeError('predicate must be a function'); } | ||
@@ -25,0 +24,0 @@ if (predicate.call(thisArg, array[0])) return array[0]; |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -20,5 +20,4 @@ * | ||
*/ | ||
function findIndex (array, predicate, thisArg = undefined) { | ||
function findIndex (array, predicate, thisArg) { | ||
if (array.length === 0) return -1; | ||
if (this == null) { throw TypeError('"this" is null or not defined'); } | ||
if (typeof predicate !== 'function') { throw TypeError('predicate must be a function'); } | ||
@@ -25,0 +24,0 @@ |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -10,0 +10,0 @@ * |
@@ -7,3 +7,3 @@ /** | ||
* @param {Function} predicate to be run against each element of the array | ||
* @param {*} [thisArg=undefined] this argument in the function | ||
* @param {*} [thisArg] this argument in the function | ||
* @returns {*} value of element that satisfied function. | ||
@@ -20,5 +20,4 @@ * | ||
*/ | ||
function findLastIndex (array, predicate, thisArg = undefined) { | ||
function findLastIndex (array, predicate, thisArg) { | ||
if (array.length === 0) return -1; | ||
if (this == null) { throw TypeError('"this" is null or not defined'); } | ||
if (typeof predicate !== 'function') { throw TypeError('predicate must be a function'); } | ||
@@ -25,0 +24,0 @@ if (predicate.call(thisArg, array[array.length - 1])) return array.length - 1; |
@@ -5,3 +5,3 @@ /** | ||
* @param {Array} array input array | ||
* @param {Function} [func] function describing how to map values | ||
* @param {Function} func function describing how to map values | ||
* @returns {Array} array of mutated values | ||
@@ -14,2 +14,2 @@ * | ||
*/ | ||
export function map(array: any[], func?: Function): any[]; | ||
export function map(array: any[], func: Function): any[]; |
@@ -5,3 +5,3 @@ /** | ||
* @param {Array} array input array | ||
* @param {Function} [func] function describing how to map values | ||
* @param {Function} func function describing how to map values | ||
* @returns {Array} array of mutated values | ||
@@ -8,0 +8,0 @@ * |
@@ -7,3 +7,3 @@ /** | ||
* @param {Object} object input object | ||
* @param {Function} [filter] predicate function to check what properties to include | ||
* @param {Function} predicate predicate function to check what properties to include | ||
* @returns {Object} object with selected properties | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
export function filter(object: any, filter?: Function): any; | ||
export function filter(object: any, predicate: Function): any; |
@@ -7,3 +7,3 @@ /** | ||
* @param {Object} object input object | ||
* @param {Function} [filter] predicate function to check what properties to include | ||
* @param {Function} predicate predicate function to check what properties to include | ||
* @returns {Object} object with selected properties | ||
@@ -17,6 +17,6 @@ * | ||
*/ | ||
function filter (object, filter) { | ||
if (typeof filter !== 'function') { return object; } | ||
function filter (object, predicate) { | ||
if (typeof predicate !== 'function') { return object; } | ||
return Object.keys(object).reduce((acc, key) => { | ||
if (filter(object[key], key, object) === true) { | ||
if (predicate(object[key], key, object) === true) { | ||
acc[key] = object[key]; | ||
@@ -23,0 +23,0 @@ } |
@@ -5,3 +5,3 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [predicate] function to test against object values | ||
* @param {function} [predicate=(x)=>x] function to test against object values | ||
* @param {*} [thisArg] value of this in a function call | ||
@@ -8,0 +8,0 @@ * @returns {string} string of the first object key whose value returns truthy against the function |
@@ -5,3 +5,3 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [predicate] function to test against object values | ||
* @param {function} [predicate=(x)=>x] function to test against object values | ||
* @param {*} [thisArg] value of this in a function call | ||
@@ -8,0 +8,0 @@ * @returns {string} string of the first object key whose value returns truthy against the function |
@@ -5,3 +5,3 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [predicate] function to test against object values | ||
* @param {function} [predicate=(x)=>x] function to test against object values | ||
* @param {*} [thisArg] value of this in a function call | ||
@@ -8,0 +8,0 @@ * @returns {string} string of the first object key whose value returns truthy against the function |
@@ -5,3 +5,3 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [predicate] function to test against object values | ||
* @param {function} [predicate=(x)=>x] function to test against object values | ||
* @param {*} [thisArg] value of this in a function call | ||
@@ -8,0 +8,0 @@ * @returns {string} string of the first object key whose value returns truthy against the function |
@@ -5,4 +5,4 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [func] iteratee function | ||
* @param {object|Array} [accumulator = {}] custom accumulator object | ||
* @param {function} func iteratee function | ||
* @param {object|Array} [accumulator={}] custom accumulator object | ||
* @returns {object|Array} returns accumulator object after the input object has been iterated over by the function. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
export function transform(object: any, func?: Function, accumulator?: any): any; | ||
export function transform(object: any, func: Function, accumulator?: any): any; |
@@ -5,4 +5,4 @@ /** | ||
* @param {object} object input object | ||
* @param {function} [func] iteratee function | ||
* @param {object|Array} [accumulator = {}] custom accumulator object | ||
* @param {function} func iteratee function | ||
* @param {object|Array} [accumulator={}] custom accumulator object | ||
* @returns {object|Array} returns accumulator object after the input object has been iterated over by the function. | ||
@@ -9,0 +9,0 @@ * |
/** | ||
* camelCase updates a string to camelcase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new camelCase string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* camelCase updates a string to camelcase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new camelCase string | ||
@@ -12,3 +12,3 @@ * | ||
*/ | ||
function camelCase (string = '') { | ||
function camelCase (string) { | ||
let first = true; | ||
@@ -15,0 +15,0 @@ const res = string.replace(/[\u2019']/, '').split(/[\u002D\u2014\-_\s]+/).reduce((acc, word) => { |
/** | ||
* Deburrs string by converting all complex Latin characters to basic Latin letters in a string. | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns simplified string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* Deburrs string by converting all complex Latin characters to basic Latin letters in a string. | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns simplified string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* kebabCase updates a string to kebabcase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new kebabCase string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* kebabCase updates a string to kebabcase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new kebabCase string | ||
@@ -12,3 +12,3 @@ * | ||
*/ | ||
function kebabCase (string = '') { | ||
function kebabCase (string) { | ||
let first = true; | ||
@@ -15,0 +15,0 @@ return string.replace(/[\u2019']/, '').split(/[\u002D\u2014\-_\s]+/).reduce((acc, word) => { |
/** | ||
* pascalCase updates a string to pascalCase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new pascalCase string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* pascalCase updates a string to pascalCase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new pascalCase string | ||
@@ -12,3 +12,3 @@ * | ||
*/ | ||
function pascalCase (string = '') { | ||
function pascalCase (string) { | ||
const res = string.replace(/[\u2019']/, '').split(/[\u002D\u2014\-_\s]+/).reduce((acc, word) => { | ||
@@ -15,0 +15,0 @@ return acc + word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); |
/** | ||
* snakeCase updates a string to snakecase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new snakeCase string | ||
@@ -6,0 +6,0 @@ * |
/** | ||
* snakeCase updates a string to snakecase | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @returns {string} returns new snakeCase string | ||
@@ -12,3 +12,3 @@ * | ||
*/ | ||
function snakeCase (string = '') { | ||
function snakeCase (string) { | ||
let first = true; | ||
@@ -15,0 +15,0 @@ return string.replace(/[\u2019']/, '').split(/[\u002D\u2014\-_\s]+/).reduce((acc, word) => { |
/** | ||
* TrimEnd trims any whitespace or the selected characters from the end of the string | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @param {string} [chars=' '] characters to remove from end of the string | ||
@@ -6,0 +6,0 @@ * @returns {string} string with the characters removed from end of the string |
/** | ||
* TrimEnd trims any whitespace or the selected characters from the end of the string | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @param {string} [chars=' '] characters to remove from end of the string | ||
@@ -13,3 +13,3 @@ * @returns {string} string with the characters removed from end of the string | ||
*/ | ||
function trimEnd (string = '', chars = ' ') { | ||
function trimEnd (string, chars = ' ') { | ||
const testChars = new Set([...chars]); | ||
@@ -16,0 +16,0 @@ let end = true; |
/** | ||
* TrimStart trims any whitespace or the selected characters from the beginning of the string | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @param {string} [chars=' '] characters to remove from beginning of string | ||
@@ -6,0 +6,0 @@ * @returns {string} string with the characters removed from beginning |
/** | ||
* TrimStart trims any whitespace or the selected characters from the beginning of the string | ||
* | ||
* @param {string} [string=''] input string | ||
* @param {string} [string] input string | ||
* @param {string} [chars=' '] characters to remove from beginning of string | ||
@@ -13,3 +13,3 @@ * @returns {string} string with the characters removed from beginning | ||
*/ | ||
function trimStart (string = '', chars = ' ') { | ||
function trimStart (string, chars = ' ') { | ||
const testChars = new Set([...chars]); | ||
@@ -16,0 +16,0 @@ let first = true; |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @param {string} [string=''] string to truncate | ||
* @param {string} [string] string to truncate | ||
* @param {Object} [options={}] object containing options | ||
@@ -8,0 +8,0 @@ * @param {number} [options.length=30] Max length of truncated string |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @param {string} [string=''] string to truncate | ||
* @param {string} [string] string to truncate | ||
* @param {Object} [options={}] object containing options | ||
@@ -18,3 +18,3 @@ * @param {number} [options.length=30] Max length of truncated string | ||
**/ | ||
function truncate (string = '', options) { | ||
function truncate (string, options) { | ||
let length = 30; | ||
@@ -21,0 +21,0 @@ let omission = '...'; |
/** | ||
* Splits `string` into an array of its words. | ||
* | ||
* @param {string} [string=''] string to inspect for words | ||
* @param {string} [string] string to inspect for words | ||
* @param {RegExp|string} [pattern] regex pattern to match words or string of characters to split words by. | ||
@@ -6,0 +6,0 @@ * @returns {Array} Returns an array of words |
/** | ||
* Splits `string` into an array of its words. | ||
* | ||
* @param {string} [string=''] string to inspect for words | ||
* @param {string} [string] string to inspect for words | ||
* @param {RegExp|string} [pattern] regex pattern to match words or string of characters to split words by. | ||
@@ -6,0 +6,0 @@ * @returns {Array} Returns an array of words |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
375760
201
4922
307