@keg-hub/jsutils
Advanced tools
Comparing version 8.5.0 to 8.6.0
@@ -5,5 +5,5 @@ 'use strict'; | ||
var uniqArr = require('./uniqArr-1600c5cf.js'); | ||
var uniqArr = require('./uniqArr-074787a2.js'); | ||
var isArr = require('./isArr-39234014.js'); | ||
require('./validate-500f268a.js'); | ||
require('./validate-23297ec2.js'); | ||
require('./isObj-6b3aa807.js'); | ||
@@ -15,3 +15,3 @@ require('./match-e3c15ed8.js'); | ||
require('./exists-c79204b1.js'); | ||
require('./identity-0ec4681d.js'); | ||
require('./identity-599bde17.js'); | ||
require('./isStr-8a57710e.js'); | ||
@@ -18,0 +18,0 @@ require('./isNum-c7164b50.js'); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var shallowEqual = require('./shallowEqual-e64662c9.js'); | ||
var shallowEqual = require('./shallowEqual-420e75a0.js'); | ||
var get = require('./get-a3872853.js'); | ||
@@ -14,2 +14,4 @@ var isColl = require('./isColl-5757310a.js'); | ||
require('./isFunc-f93803cb.js'); | ||
require('./exists-c79204b1.js'); | ||
require('./validate-23297ec2.js'); | ||
require('./isNum-c7164b50.js'); | ||
@@ -24,2 +26,3 @@ require('./isStr-8a57710e.js'); | ||
exports.mapColl = shallowEqual.mapColl; | ||
exports.mapFind = shallowEqual.mapFind; | ||
exports.reduceColl = shallowEqual.reduceColl; | ||
@@ -26,0 +29,0 @@ exports.repeat = shallowEqual.repeat; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var uniqArr = require('./uniqArr-1600c5cf.js'); | ||
var uniqArr = require('./uniqArr-074787a2.js'); | ||
var isArr = require('./isArr-39234014.js'); | ||
@@ -11,3 +11,3 @@ var isBool = require('./isBool-aa6af74e.js'); | ||
var softFalsy = require('./softFalsy-3d7ead1c.js'); | ||
var shallowEqual = require('./shallowEqual-e64662c9.js'); | ||
var shallowEqual = require('./shallowEqual-420e75a0.js'); | ||
var get = require('./get-a3872853.js'); | ||
@@ -24,4 +24,4 @@ var isColl = require('./isColl-5757310a.js'); | ||
var hasOwn = require('./hasOwn-7999ca65.js'); | ||
var parseErrorMessage = require('./parseErrorMessage-b54e1944.js'); | ||
var identity = require('./identity-0ec4681d.js'); | ||
var parseErrorMessage = require('./parseErrorMessage-3126903c.js'); | ||
var identity = require('./identity-599bde17.js'); | ||
var isFunc = require('./isFunc-f93803cb.js'); | ||
@@ -38,3 +38,3 @@ var match = require('./match-e3c15ed8.js'); | ||
var wait = require('./wait-8ca88995.js'); | ||
var joinRegex = require('./joinRegex-eadd6451.js'); | ||
var joinRegex = require('./joinRegex-8c92aad3.js'); | ||
var getWordEndingAt = require('./getWordEndingAt-e40a7cea.js'); | ||
@@ -44,4 +44,4 @@ var isStr = require('./isStr-8a57710e.js'); | ||
var toStr = require('./toStr-8e499966.js'); | ||
var validate = require('./validate-500f268a.js'); | ||
var getURLParam = require('./getURLParam-c1c8bb19.js'); | ||
var validate = require('./validate-23297ec2.js'); | ||
var getURLParam = require('./getURLParam-9181a551.js'); | ||
@@ -77,2 +77,3 @@ | ||
exports.mapColl = shallowEqual.mapColl; | ||
exports.mapFind = shallowEqual.mapFind; | ||
exports.reduceColl = shallowEqual.reduceColl; | ||
@@ -79,0 +80,0 @@ exports.repeat = shallowEqual.repeat; |
@@ -6,4 +6,4 @@ 'use strict'; | ||
var hasOwn = require('./hasOwn-7999ca65.js'); | ||
var parseErrorMessage = require('./parseErrorMessage-b54e1944.js'); | ||
var identity = require('./identity-0ec4681d.js'); | ||
var parseErrorMessage = require('./parseErrorMessage-3126903c.js'); | ||
var identity = require('./identity-599bde17.js'); | ||
var isFunc = require('./isFunc-f93803cb.js'); | ||
@@ -13,3 +13,3 @@ var deepClone = require('./deepClone-4dc3bb5a.js'); | ||
require('./isArr-39234014.js'); | ||
require('./validate-500f268a.js'); | ||
require('./validate-23297ec2.js'); | ||
require('./isNum-c7164b50.js'); | ||
@@ -16,0 +16,0 @@ require('./isStr-8a57710e.js'); |
@@ -5,6 +5,6 @@ 'use strict'; | ||
var joinRegex = require('./joinRegex-eadd6451.js'); | ||
var joinRegex = require('./joinRegex-8c92aad3.js'); | ||
require('./isStr-8a57710e.js'); | ||
require('./isArr-39234014.js'); | ||
require('./validate-500f268a.js'); | ||
require('./validate-23297ec2.js'); | ||
require('./match-e3c15ed8.js'); | ||
@@ -11,0 +11,0 @@ require('./deepFreeze-d73ccc57.js'); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var getURLParam = require('./getURLParam-c1c8bb19.js'); | ||
var getURLParam = require('./getURLParam-9181a551.js'); | ||
require('./reduceObj-f41cbf8d.js'); | ||
@@ -15,3 +15,3 @@ require('./isFunc-f93803cb.js'); | ||
require('./isArr-39234014.js'); | ||
require('./validate-500f268a.js'); | ||
require('./validate-23297ec2.js'); | ||
@@ -18,0 +18,0 @@ |
@@ -1,4 +0,4 @@ | ||
export { a as areCountMapsEqual, c as areFrequencyEqual, d as areSetEqual, b as buildElementCountMap, e as cloneArr, f as eitherArr, g as ensureArr, j as findExtrema, k as findMax, l as findMin, h as flatArr, i as flatMap, o as omitRange, r as randomArr, m as randomizeArr, n as uniqArr, u as uniqArrByReference } from './uniqArr-861358da.js'; | ||
export { a as areCountMapsEqual, c as areFrequencyEqual, d as areSetEqual, b as buildElementCountMap, e as cloneArr, f as eitherArr, g as ensureArr, j as findExtrema, k as findMax, l as findMin, h as flatArr, i as flatMap, o as omitRange, r as randomArr, m as randomizeArr, n as uniqArr, u as uniqArrByReference } from './uniqArr-20146d33.js'; | ||
export { i as isArr } from './isArr-a4420764.js'; | ||
import './validate-0eec5ac6.js'; | ||
import './validate-0a7295ee.js'; | ||
import './isObj-2a71d1af.js'; | ||
@@ -10,3 +10,3 @@ import './match-39e2fa8f.js'; | ||
import './exists-bf542cb8.js'; | ||
import './identity-331fe668.js'; | ||
import './identity-3f419fcd.js'; | ||
import './isStr-481ce69b.js'; | ||
@@ -13,0 +13,0 @@ import './isNum-cc6ad9ca.js'; |
@@ -1,2 +0,2 @@ | ||
export { c as cleanColl, d as deepEqual, i as isEmptyColl, m as mapColl, r as reduceColl, a as repeat, s as shallowEqual, u as unset } from './shallowEqual-fbdc10a6.js'; | ||
export { c as cleanColl, d as deepEqual, i as isEmptyColl, m as mapColl, a as mapFind, r as reduceColl, b as repeat, s as shallowEqual, u as unset } from './shallowEqual-27dcbfec.js'; | ||
export { g as get } from './get-c06a1288.js'; | ||
@@ -9,4 +9,6 @@ export { i as isColl } from './isColl-15a1452b.js'; | ||
import './isFunc-40ceeef8.js'; | ||
import './exists-bf542cb8.js'; | ||
import './validate-0a7295ee.js'; | ||
import './isNum-cc6ad9ca.js'; | ||
import './isStr-481ce69b.js'; | ||
//# sourceMappingURL=collection.js.map |
@@ -1,2 +0,2 @@ | ||
export { a as areCountMapsEqual, c as areFrequencyEqual, d as areSetEqual, b as buildElementCountMap, e as cloneArr, f as eitherArr, g as ensureArr, j as findExtrema, k as findMax, l as findMin, h as flatArr, i as flatMap, o as omitRange, r as randomArr, m as randomizeArr, n as uniqArr, u as uniqArrByReference } from './uniqArr-861358da.js'; | ||
export { a as areCountMapsEqual, c as areFrequencyEqual, d as areSetEqual, b as buildElementCountMap, e as cloneArr, f as eitherArr, g as ensureArr, j as findExtrema, k as findMax, l as findMin, h as flatArr, i as flatMap, o as omitRange, r as randomArr, m as randomizeArr, n as uniqArr, u as uniqArrByReference } from './uniqArr-20146d33.js'; | ||
export { i as isArr } from './isArr-a4420764.js'; | ||
@@ -6,3 +6,3 @@ export { i as isBool } from './isBool-4d844d9e.js'; | ||
export { s as softFalsy } from './softFalsy-b9d5bbac.js'; | ||
export { c as cleanColl, d as deepEqual, i as isEmptyColl, m as mapColl, r as reduceColl, a as repeat, s as shallowEqual, u as unset } from './shallowEqual-fbdc10a6.js'; | ||
export { c as cleanColl, d as deepEqual, i as isEmptyColl, m as mapColl, a as mapFind, r as reduceColl, b as repeat, s as shallowEqual, u as unset } from './shallowEqual-27dcbfec.js'; | ||
export { g as get } from './get-c06a1288.js'; | ||
@@ -19,4 +19,4 @@ export { i as isColl } from './isColl-15a1452b.js'; | ||
export { a as applyToFunc, h as hasOwn, p as pipeline } from './hasOwn-deb5bbb8.js'; | ||
export { c as checkCall, a as complement, d as debounce, b as doIt, e as eitherFunc, h as hasDomAccess, l as limbo, m as memorize, p as parseErrorMessage, r as runSeq, f as throttle, g as throttleLast, t as timedRun, u as uuid } from './parseErrorMessage-475a1f22.js'; | ||
export { c as compareTo, a as identity, i as isOrderable } from './identity-331fe668.js'; | ||
export { c as checkCall, a as complement, d as debounce, b as doIt, e as eitherFunc, h as hasDomAccess, l as limbo, m as memorize, p as parseErrorMessage, r as runSeq, f as throttle, g as throttleLast, t as timedRun, u as uuid } from './parseErrorMessage-477d48b0.js'; | ||
export { c as compareTo, a as identity, i as isOrderable } from './identity-3f419fcd.js'; | ||
export { i as isFunc } from './isFunc-40ceeef8.js'; | ||
@@ -33,3 +33,3 @@ export { m as match, n as noOp, a as noOpObj, c as noPropArr, b as noPropObj } from './match-39e2fa8f.js'; | ||
export { p as promisify, a as promisifyAll, w as wait } from './wait-26c5e7c6.js'; | ||
export { g as getRegexSource, i as isRegex, j as joinRegex } from './joinRegex-8ea25337.js'; | ||
export { g as getRegexSource, i as isRegex, j as joinRegex } from './joinRegex-0cc5f504.js'; | ||
export { b as buildPath, c as camelCase, f as camelCasePath, e as capitalize, a as cleanStr, g as containsStr, d as delimitString, h as eitherStr, F as getNearestDelimiterIndex, E as getWordEndingAt, G as getWordStartingAt, j as hashString, i as hyphenator, k as isEmail, y as isLowerCase, l as isPhone, C as isQuoted, x as isUpperCase, n as isUrl, o as isUuid, m as mapString, p as parseJSON, q as plural, r as removeDot, D as reverseStr, t as singular, s as snakeCase, z as spaceJoin, u as styleCase, A as template, v as trainCase, B as validFilename, w as wordCaps } from './getWordEndingAt-2a7a71cc.js'; | ||
@@ -39,4 +39,4 @@ export { i as isStr } from './isStr-481ce69b.js'; | ||
export { t as toStr } from './toStr-0e5fe94c.js'; | ||
export { v as validate } from './validate-0eec5ac6.js'; | ||
export { g as getURLParam, i as isValidUrl, o as objToQuery, q as queryToObj } from './getURLParam-48671df2.js'; | ||
export { v as validate } from './validate-0a7295ee.js'; | ||
export { g as getURLParam, i as isValidUrl, o as objToQuery, q as queryToObj } from './getURLParam-1cd8d86f.js'; | ||
//# sourceMappingURL=index.js.map |
export { a as applyToFunc, p as pipeline } from './hasOwn-deb5bbb8.js'; | ||
export { c as checkCall, a as complement, d as debounce, b as doIt, e as eitherFunc, h as hasDomAccess, l as limbo, m as memorize, p as parseErrorMessage, r as runSeq, f as throttle, g as throttleLast, t as timedRun, u as uuid } from './parseErrorMessage-475a1f22.js'; | ||
export { c as compareTo, a as identity, i as isOrderable } from './identity-331fe668.js'; | ||
export { c as checkCall, a as complement, d as debounce, b as doIt, e as eitherFunc, h as hasDomAccess, l as limbo, m as memorize, p as parseErrorMessage, r as runSeq, f as throttle, g as throttleLast, t as timedRun, u as uuid } from './parseErrorMessage-477d48b0.js'; | ||
export { c as compareTo, a as identity, i as isOrderable } from './identity-3f419fcd.js'; | ||
export { i as isFunc } from './isFunc-40ceeef8.js'; | ||
@@ -8,3 +8,3 @@ export { a as cloneFunc } from './deepClone-bbe59305.js'; | ||
import './isArr-a4420764.js'; | ||
import './validate-0eec5ac6.js'; | ||
import './validate-0a7295ee.js'; | ||
import './isNum-cc6ad9ca.js'; | ||
@@ -11,0 +11,0 @@ import './isStr-481ce69b.js'; |
@@ -1,5 +0,5 @@ | ||
export { g as getRegexSource, i as isRegex, j as joinRegex } from './joinRegex-8ea25337.js'; | ||
export { g as getRegexSource, i as isRegex, j as joinRegex } from './joinRegex-0cc5f504.js'; | ||
import './isStr-481ce69b.js'; | ||
import './isArr-a4420764.js'; | ||
import './validate-0eec5ac6.js'; | ||
import './validate-0a7295ee.js'; | ||
import './match-39e2fa8f.js'; | ||
@@ -6,0 +6,0 @@ import './deepFreeze-0437aacd.js'; |
@@ -1,2 +0,2 @@ | ||
export { g as getURLParam, i as isValidUrl, o as objToQuery, q as queryToObj } from './getURLParam-48671df2.js'; | ||
export { g as getURLParam, i as isValidUrl, o as objToQuery, q as queryToObj } from './getURLParam-1cd8d86f.js'; | ||
import './reduceObj-efaed709.js'; | ||
@@ -10,3 +10,3 @@ import './isFunc-40ceeef8.js'; | ||
import './isArr-a4420764.js'; | ||
import './validate-0eec5ac6.js'; | ||
import './validate-0a7295ee.js'; | ||
//# sourceMappingURL=url.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsutils={})}(this,(function(e){"use strict";const t={SHOULD_LOG:!0,SHOULD_THROW:!1,LOG_PREFIX:null},r=(e,r={},{logs:s=t.SHOULD_LOG,throws:i=t.SHOULD_THROW,prefix:u=t.LOG_PREFIX}={})=>{const c=Object.entries(e),l=()=>!0,a=c.map((([e,t])=>n(e,t,r[e]||r.$default||l))),{success:f,cases:p}=a.reduce(((e,t)=>o(e,t,{logs:s,throws:i,prefix:u})),{success:!0,cases:{}});return[f,p]};r.setOptions=({logs:e,throws:r,prefix:n})=>{void 0!==e&&(t.SHOULD_LOG=e),void 0!==r&&(t.SHOULD_THROW=r),void 0!==n&&(t.LOG_PREFIX=n)},r.resetOptions=()=>{t.SHOULD_LOG=!0,t.SHOULD_THROW=!1,t.LOG_PREFIX=null};const n=(e,t,r)=>{const n=r(t),o=!r.name||r.name===e||"$default"===r.name?r.toString():r.name;return{success:n,key:e,value:t,validator:r,reason:n?null:[`Argument "${e}" with value `,t,` failed validator: ${o}.`]}},o=(e,t,{logs:r,throws:n,prefix:o})=>(!t.success&&s(t,r,n,o),{success:e.success&&t.success,cases:{...e.cases,[t.key]:t}}),s=(e,t,r,n)=>{const o=n?[n,...e.reason]:e.reason;if(r)throw new Error(o.join());t&&console.error(...o)},i=e=>Array.isArray(e),u=e=>{const t=new Map;for(let n=0;n<e.length;n++){var r;const o=e[n],s=null!==(r=t.get(o))&&void 0!==r?r:0;t.set(o,s+1)}return t},c=(e,t)=>{if(e.size!==t.size)return!1;for(let[r,n]of e){if(t.get(r)!==n)return!1}return!0},l=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,a=e=>"function"==typeof e,f=e=>(Object.freeze(e),Object.getOwnPropertyNames(e).map((t=>{e.hasOwnProperty(t)&&null!==e[t]&&("object"==typeof e[t]||a(e[t]))&&!Object.isFrozen(e[t])&&f(e[t])})),e),p=Object.freeze({}),d=f({content:{}}),g=f([]),m=e=>e==e&&null!=e,y=(e,t,r)=>{for(let n=0;n<e.length;n++){const o=e[n];i(o)?y(o,t,r):r.exists&&!m(o)||r.truthy&&!o||t.push(o)}return r.mutate?(Object.assign(e,t).splice(t.length),e):t},h=(e,t)=>{if(i(t)){const[r,...n]=t;return r(e,...n)}return a(t)?t(e):(console.error("Pipeline expected either a function or an array (for function expressions). Found "+typeof t),e)},O=(e,...t)=>t.reduce(((e,t)=>h(e,t)),e),b=e=>"string"==typeof e,j=(e,t)=>{if(!b(e))return e;if(!a(t))return e;let r="";for(const n of e)r+=t(n);return r},w=e=>e===e.toLowerCase(),S=e=>e===e.toUpperCase(),A=(e,t,r=["-","_"," "])=>{if(!b(e))return e;const n=e=>r.some((t=>t===e));let o="_";return j(e,(e=>n(e)?(o=t,t):S(e)&&w(o)&&!n(o)?(o=e,t+e):(o=e,e)))},$=(e,t=!0)=>{if(!b(e)||!e[0])return e;const r=t?e.slice(1).toLowerCase():e.slice(1);return`${e[0].toUpperCase()}${r}`},v=e=>{const t=0===e.indexOf(".")?e.slice(1):e;return t.indexOf(".")===t.length-1?t.slice(0,-1):t},_=e=>e&&v(e).replace(/[-_]/gm," ")||e,C=(e,t)=>e&&_(e).split(/[\s_-]/gm).reduce(((e,r,n)=>r?e+=(n>0||t)&&$(r)||r.toLowerCase():e),"")||e,x=e=>null==e?"":b(e)?e:JSON.stringify(e),E=/[A-Z]/g,F=/^ms-/,P={},R=e=>"-"+e.toLowerCase(),L=e=>"number"==typeof e&&e!=e,T=e=>"number"==typeof e&&!L(e),I=e=>T(e)&&e>=0,N=e=>b(e)&&e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")||e,D=e=>"object"==typeof e&&null!==e,U=(e,t,r,n)=>{const o=e;if(!D(e)||!e||!t)return"set"!==r&&n||void 0;const s=i(t)?Array.from(t):t.split("."),u=s.pop();let c,l;for(;c=s.shift();){const t=e[c];if(D(t)||a(t)?e=t:("set"===r?e[c]={}:l=!0,e=e[c]),l)return n}return"get"===r?u in e?e[u]:n:"unset"===r?delete e[u]:(e[u]=n)&&o||o},k=(e,t,r)=>U(e,t,"get",r),M=(e,t,r="")=>{t=D(t)&&t||{};const n=M.regex||/\${(.*?)\}/g;return b(e)?e.replace(n,((e,n)=>{const o=(n||e.substr(2,e.length-3)).trim(),s=k(t,o,r);return a(s)?s(t,o,r):s})):console.error("template requires a string as the first argument")||e},q=['"',"'"],z=e=>{if(!b(e))return;let t="";for(let r of e)t=r+t;return t},J=(e,t,r)=>r.map((r=>e.indexOf(r,t))).sort().find((e=>e>=0)),B=(e,t,r=[" "])=>{const n=J(e,t,r);return e.substring(t,-1===n?e.length:n)},H=e=>"boolean"==typeof e,G=e=>"false"===e||"true"===e,W=e=>H(e)?x(e):e&&"false"!==e&&"0"!==e?"true":"false",K=e=>Boolean(e||""===e||0===e),X=e=>G(e)?"true"===e:"true"===W(e),Q=e=>x(e).replace(/([^.\d])/gm,""),V=e=>T(e)?e:e&&!L(e)&&Number(Q(e))||0,Z=e=>b(e)||T(e)||H(e),Y=(e,t)=>{const[n]=r({x:e,y:t},{$default:Z});return n?b(e)?e.localeCompare(t):e-t:null},ee=e=>e,te=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),re=e=>{const t=function(...r){return e instanceof t||k(e.prototype,"constructor.name")?new e(...r):e.apply(e,r)};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return Object.defineProperty(t,"name",{value:e.name,configurable:!0}),t.toString=()=>e.toString(),t},ne=(e,t=new WeakMap)=>{if(Object(e)!==e)return e;if(e instanceof Set)return new Set(e);if(t.has(e))return t.get(e);if(i(e))return e.map((e=>ne(e)));if(a(e))return re(e);const r=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?null:Object.create(null);return null===r?oe(e):(t.set(e,r),e instanceof Map?Array.from(e,(([e,n])=>r.set(e,ne(n,t)))):Object.assign(r,...Object.keys(e).map((r=>({[r]:ne(e[r],t)})))))},oe=e=>{if(!e)return e;const t=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptors(e);for(const[e,t]of Object.entries(r))t.value&&(r[e].value=ne(t.value));const n=Object.create(t,r);return Object.isFrozen(e)&&Object.freeze(n),Object.isSealed(e)&&Object.seal(n),n},se=e=>e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,se),ie=e=>Object.prototype.toString.call(e).slice(8,-1),ue=(e,...t)=>{if(!t.length)return null;for(let r of t){if(!i(r)){console.error(`Matching case must be an entry (a 2-element array). Found: ${ie(r)}`,r);break}const[t,n]=r;if(a(t)&&t(e))return n;if(t===e)return n}return null};ue.default=()=>!0;const ce=e=>l(e)?0===Object.keys(e).length:i(e)?0===e.length:b(e)?0===e.trim().length:!!T(e)&&e<1,le=(e,t)=>{const[n]=r({arr:e,comparator:t},{arr:i,$default:a});return n&&e.length?e.reduce(((e,r)=>t(e,r)>0?e:r)):null},ae=e=>i(e)?e.filter(((e,t,r)=>r.indexOf(e)==t)):e,fe=(e,t=!0)=>D(e)?Object.keys(e).reduce(((r,n)=>{const o=e[n];return null==o||(r[n]=t&&D(o)?fe(o):o),r}),l(e)&&{}||[]):console.error("cleanColl requires a collection as the first argument")||e,pe=(e,t,r)=>U(e,t,"set",r),de=Array.isArray,ge=Object.keys,me=Object.prototype.hasOwnProperty,ye=(e,t)=>{if(e===t)return!0;if(!e||!t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;const r=de(e),n=de(t);let o,s,i;if(r&&n){if(s=e.length,s!=t.length)return!1;for(o=s;0!=o--;)if(!ye(e[o],t[o]))return!1;return!0}if(r!=n)return!1;const u=e instanceof Date,c=t instanceof Date;if(u!=c)return!1;if(u&&c)return e.getTime()==t.getTime();const l=e instanceof RegExp,a=t instanceof RegExp;if(l!=a)return!1;if(l&&a)return e.toString()==t.toString();const f=ge(e);if(s=f.length,s!==ge(t).length)return!1;for(o=s;0!=o--;)if(!me.call(t,f[o]))return!1;for(o=s;0!=o--;)if(i=f[o],!ye(e[i],t[i]))return!1;return!0},he=e=>e&&b(e)?G(e)?X(e):T(e)?V(e):(()=>{try{return JSON.parse(e)}catch(t){return e}})():e;let Oe,be="dir",je="type";const we=["error","info","log","dir","warn"],Se=(...e)=>{if(!e.length)return;let t=1===e.length?be:e.pop();(Oe||"error"===t)&&("string"==typeof e[0]&&("type"===je?e[0]=`[ ${t.toUpperCase()} ] ${e[0]}`:je&&(e[0]=`${je} ${e[0]}`)),-1!==we.indexOf(t)?console[t](...e):console[be](...e,t))},Ae=(e,t)=>{e&&Object.entries(e).map((([r,n])=>{t&&-1!==t.indexOf(r)||("object"==typeof n&&Ae(n),e[r]=void 0,delete e[r])}))},$e=(...e)=>e.reduce(((e,t)=>{const r=ne(t);return i(r)?[...i(e)&&e||[],...r]:l(r)?Object.entries(r).reduce(((e,[t,r])=>({...e,[t]:a(r)?re(r):D(r)&&t in e?$e(e[t],r):ne(r)})),e):e}),i(e[0])&&[]||{}),ve=e=>i(e)&&2===e.length&&(T(e[0])||b(e[0])),_e=(e,t)=>{if(!i(e)&&!l(e))return console.error(e,"Expected array or object for obj. Found "+typeof e),e;if(!a(t))return console.error("Expected function for cb. Found "+typeof t),e;const r=Object.entries(e),n=i(e)?[]:{};return r.reduce(((e,[r,n])=>{const o=t(r,n);return ve(o)?pe(e,o[0],o[1]):(console.error(`Callback function must return entry. Found: ${o}. Using current entry instead.`),pe(e,r,n))}),n)},Ce=(e,t,r={})=>l(e)&&a(t)&&Object.entries(e).reduce(((e,[r,n])=>t(r,n,e)),r)||r,xe=e=>{if(!a(e))throw"Argument must be a function";return(...t)=>new Promise(((r,n)=>a(t[t.length-1])?(t.pop(),t.push(((...e)=>e&&e[0]?n(...e):r(...e))),e(...t)):r(e(...t))))},Ee=Array.from(["caller","callee","arguments","apply","bind","call","toString","__proto__","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString"]).concat(Object.getOwnPropertyNames(Object.prototype)).reduce(((e,t)=>(e[t]=!0,e)),{}),Fe=e=>{if(!e.__IS_PROMISIFIED__){for(const t of Object.getOwnPropertyNames(e)){if(!(-1!==t.indexOf("Async")||e[`${t}Async`])&&!Ee[t])if(a(e[t]))e[`${t}Async`]=xe(e[t]);else{const r=Object.getOwnPropertyDescriptor(e,t).get;a(r)&&(e[`${t}Async`]=xe(r))}}e.__IS_PROMISIFIED__=!0}return e},Pe=e=>Boolean(e&&e instanceof RegExp),Re=e=>Pe(e)?e.source:b(e)?e:null,Le=e=>{const t={},r=e.split("?"),n=r[r.length-1];if(!n)return t;const o=n.split("&");return o.length&&o.map((e=>{const r=e.split("=");if(r.length<=1)return t;const n=[r.shift(),r.join("=")];if(2===n.length){const e=decodeURIComponent(n[1]).split(",");if(e&&e.length>1)t[n[0]]=e;else if(n[0]in t){const e=t[n[0]];t[n[0]]=i(e)?e.push(decodeURIComponent(n[1])):[e,decodeURIComponent(n[1])]}else t[n[0]]=decodeURIComponent(n[1])}})),t};e.applyToCloneOf=(e,t)=>{let r;if(e||(r="object (Argument 1) in applyToCloneOf, must be defined!"),l(e)||(r="object (Argument 1) in applyToCloneOf, must be an object!"),t||(r="mutator (Argument 2) in applyToCloneOf, must be defined!"),a(t)||(r="mutator (Argument 2) arg in applyToCloneOf, must be a function!"),r)return console.warn(r)||e;const n=ne(e);return t(n),n},e.applyToFunc=h,e.areCountMapsEqual=c,e.areFrequencyEqual=(e,t)=>{const[n]=r({arr:e,otherArr:t},{$default:i});if(!n)return null;if(e===t)return!0;if(e.length!==t.length)return!1;const o=u(e),s=u(t);return c(o,s)},e.areSetEqual=(e,t)=>{const[n]=r({arr:e,otherArr:t},{$default:i});if(!n)return null;if(e===t)return!0;const[o,s]=e.length>t.length?[e,t]:[t,e],u=new Set(s);for(let e=0;e<o.length;e++){const t=o[e];if(!u.has(t))return!1}return!0},e.buildElementCountMap=u,e.buildPath=(...e)=>e.reduce(((e,t)=>{let r=toStr(t);return`${e}${r&&"/"+r||""}`}),"").replace(/([^:\/]|^)\/{2,}/g,"$1/"),e.camelCase=C,e.camelCasePath=e=>{const t=e.split(".").map(((e,t)=>t>0?$(e,!1):e));return t.length>1?t.join(""):e},e.capitalize=$,e.checkCall=(e,...t)=>a(e)?e(...t):void 0,e.cleanColl=fe,e.cleanStr=_,e.clearObj=Ae,e.cloneArr=e=>Array.from([...i(e)&&e||l(e)&&Object.entries(e)||[]]),e.cloneFunc=re,e.cloneJson=e=>{try{return JSON.parse(JSON.stringify(e))}catch(e){return Se(e.message,"error"),null}},e.cloneObjWithPrototypeAndProperties=oe,e.compareTo=Y,e.complement=e=>{const[t]=r({predicate:e},{predicate:a});return t?(...t)=>!e(...t):null},e.containsStr=(e,t,r)=>(e=!b(e)&&x(e)||e,t=!b(t)&&x(t)||t,-1!==e.indexOf(t,r)),e.convertToStrBool=W,e.debounce=(e,t=250,r=!1)=>{let n;return function(...o){if(!a(e))return null;const s=this,i=r&&!n;return clearTimeout(n),n=setTimeout((()=>{n=null,!r&&e.apply(s,o)}),t),i?a(e)&&e.apply(s,o):void 0}},e.deepClone=ne,e.deepEqual=ye,e.deepFreeze=f,e.deepMerge=$e,e.delimitString=A,e.doIt=(...e)=>{const t=e.slice(),r=t.shift(),n=t.shift(),o=t.pop();if(!T(r)||!a(o))return[];const s=new Array(r),i=[];for(let e=0;e<s.length;e++){const r=o.call(n,e,...t);if(!1===r)break;i.push(r)}return i},e.either=(e,t,r)=>a(r)?r(e,t)&&e||t:K(e)&&e||t,e.eitherArr=(e,t)=>i(e)?e:t,e.eitherFunc=(e,t)=>a(e)&&e||t,e.eitherObj=(e,t)=>l(e)&&e||t,e.eitherStr=(e,t)=>b(e)&&e||t,e.ensureArr=e=>i(e)?e:[e],e.equalsNaN=L,e.everyEntry=(e,t)=>e?l(e)?a(t)?O(e,Object.entries,(e=>e.every((([e,r])=>t(e,r))))):(console.error(`Argument 'predicate' passed into everyEntry must a function. Found: ${t}`),!1):(console.error(`Argument obj ${e} must be an object.`),!1):(console.error(`everyEntry expects argument obj [${e}] to be defined.`),!1),e.exists=m,e.filterObj=(e,t)=>e?l(e)?a(t)?Ce(e,((e,r,n)=>(t(e,r)&&(n[e]=r),n)),{}):(console.error(`Argument 'predicate' passed into filterObject must a function. Found: ${t}`),e):(console.error(`Object ${e} was not an object. It must be for filterObject`),e):e,e.findExtrema=le,e.findMax=(e=[],t=ee)=>le(e,((e,r)=>Y(t(e),t(r)))),e.findMin=(e=[],t=ee)=>le(e,((e,r)=>Y(t(r),t(e)))),e.flatArr=(e,t)=>y(e,[],l(t)?t:p),e.flatMap=(e,t)=>{const[n]=r({arr:e,mapFn:t},{arr:i,mapFn:a});return n?e.reduce(((e,r)=>{const n=t(r);return i(n)?n.map((t=>e.push(t))):e.push(n),e}),[]):e},e.get=k,e.getNearestDelimiterIndex=J,e.getNums=Q,e.getRegexSource=Re,e.getURLParam=e=>{var t,n,o;const[s]=r({paramKey:e},{paramKey:b});if(!s)return null;const i="undefined"!=typeof document?document:null,u=null==i||null===(t=i.location)||void 0===t?void 0:t.search;return b(u)&&null!==(n=null===(o=Le(u))||void 0===o?void 0:o[e])&&void 0!==n?n:null},e.getWordEndingAt=(e,t,r=[" "])=>{const n=z(e),o=e.length-t;return z(B(n,o,r))},e.getWordStartingAt=B,e.hasDomAccess=()=>{try{return!("undefined"==typeof window||!window.document||!window.document.createElement)}catch(e){return!1}},e.hasOwn=te,e.hashString=(e,t)=>{if(!b(e)||0==e.length)return 0;e=e.split("").reverse().join("");let r=0;for(let t=0;t<e.length;t++){r=(r<<5)-r+e.charCodeAt(t),r=`${Math.abs(r&r)}`}return I(t)?r.slice(0,t):r},e.hyphenator=e=>{if(P.hasOwnProperty(e))return P[e];const t=e.replace(E,R);return P[e]=F.test(t)?"-"+t:t},e.identity=ee,e.isArr=i,e.isArrMap=e=>{if(!l(e))return!1;const t=Object.values(e);return X(t.length&&t.every(i))},e.isBool=H,e.isColl=D,e.isEmail=e=>{if(!e||!b(e))return!1;return Boolean(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(e))},e.isEmpty=ce,e.isEmptyColl=e=>i(e)?0===e.length:D(e)&&0===Object.getOwnPropertyNames(e).length,e.isEntry=ve,e.isFloat=e=>T(e)&&e%1!=0,e.isFunc=a,e.isInt=e=>T(e)&&e%1==0,e.isLowerCase=w,e.isNegative=e=>T(e)&&e<0,e.isNonNegative=I,e.isNum=T,e.isObj=l,e.isOrderable=Z,e.isPhone=e=>{if(!e||!b(e))return!1;return Boolean(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test(e))&&e.replace(/\D/g,"").length<11},e.isPositive=e=>T(e)&&e>0,e.isQuoted=(e,t=q)=>b(e)&&t.some((t=>e.startsWith(t)&&e.endsWith(t))),e.isRegex=Pe,e.isSame=(e,t)=>e===t?0!==e||1/e==1/t:e!=e&&t!=t,e.isStr=b,e.isStrBool=G,e.isUpperCase=S,e.isUrl=e=>Boolean(/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)),e.isUuid=e=>{if(!e||!b(e))return!1;return Boolean(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))},e.isValidDate=e=>!isNaN((e instanceof Date&&e||new Date(e)).getTime()),e.isValidUrl=e=>/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/.test(e),e.joinRegex=(...e)=>{const[t,r]=(e=>{if(i(e[0]))return[e[0],e[1]];const t=e[e.length-1],r=b(t)?t:void 0;return[r?e.splice(0,e.length-1):e,r]})(e),n=t.reduce(((e,t)=>{const r=Re(t);return r?""===e?r:`${e}|${r}`:e}),"");return new RegExp(`(${n})`,r)},e.jsonEqual=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(e){return!1}},e.keyMap=(e,t)=>i(e)&&e.reduce(((e,r)=>{if(!b(r))return e;const n=t&&r.toUpperCase()||r;return e[n]=n,e}),{})||{},e.limbo=e=>e&&a(e.then)?e.then((e=>[null,e])).catch((e=>[e,void 0])):[new Error("A promise or thenable is required as the first argument!"),null],e.logData=Se,e.mapColl=(e,t)=>a(t)&&D(e)?Object.keys(e).map((r=>t(r,e[r],e))):i(e)?[]:{},e.mapEntries=_e,e.mapKeys=(e,t)=>l(e)&&a(t)?_e(e,((e,r)=>[t(e),r])):e,e.mapObj=(e,t)=>l(e)&&a(t)&&Object.entries(e).map((([e,r])=>t(e,r)))||e,e.mapString=j,e.match=ue,e.memorize=(e,t,r=1)=>{if(!a(e)||t&&!a(t))return console.error("Error: Expected a function",e,t);let n=function(){const o=n.cache,s=t?t.apply(this,arguments):arguments[0];if(te(o,s))return o[s];const i=e.apply(this,arguments);return T(r)&&Object.keys(o).length<r?o[s]=i:n.cache={[s]:i},i};return n.cache={},n.destroy=()=>{t=void 0,n.cache=void 0,n.destroy=void 0,n=void 0},n},e.mod=(e,t)=>(e%t+t)%t,e.noOp=()=>{},e.noOpObj=p,e.noPropArr=g,e.noPropObj=d,e.nth=e=>{if(!T(e)){if(!(e=Q(e)))return"";if(e=V(e),L(e))return""}const t=e%100;if(t>=10&&t<=20)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},e.objToQuery=e=>{let t;return Ce(e,((e,r,n)=>{if(!r)return n;const o=b(r)||T(r)||H(r)?r:D(r)?i(r)?r.join(","):JSON.stringify(r):null;return o?(n=t?`${n}&${encodeURIComponent(e)}=${encodeURIComponent(o)}`:`?${encodeURIComponent(e)}=${encodeURIComponent(o)}`,t=!0,n):n}),"")},e.omitKeys=(e={},t=[])=>l(e)&&Ce(e,((r,n,o)=>(-1===t.indexOf(r)&&(o[r]=e[r]),o)),{})||{},e.omitRange=(e,t,n)=>{const[o]=r({arr:e,startIndex:t,count:n},{arr:i,$default:I});if(!o)return e;const s=[...e];return s.splice(t,n),s},e.parseErrorMessage=e=>b(e)&&!ce(e)?e:l(e)?e.message:null,e.parseJSON=e=>{try{return JSON.parse(e)}catch(e){return console.error(e.message),null}},e.pickKeys=(e={},t=[])=>l(e)&&t.reduce(((t,r)=>(r in e&&(t[r]=e[r]),t)),{})||{},e.pipeline=O,e.plural=e=>e&&e.length&&"s"!==e[e.length-1]?e+"s":e,e.promisify=xe,e.promisifyAll=e=>{if(!l(e))return e;Fe(e);const t=Object.getPrototypeOf(e);return t&&null!==Object.getPrototypeOf(t)&&Fe(t),e},e.queryToObj=Le,e.randomArr=(e,t)=>{if(!i(e))return e;const r=t||1,n=[];for(let t=0;t<r;t++)n.push(e[Math.floor(Math.random()*e.length)]);return t?n:n[0]},e.randomizeArr=e=>!i(e)&&e||e.sort((()=>.5-Math.random())),e.reduceColl=(e,t,r)=>a(t)&&D(e)?Object.keys(e).reduce(((r,n)=>t(n,e[n],e,r)),r):i(e)?[]:{},e.reduceObj=Ce,e.removeDot=v,e.repeat=(e,t,r=!1)=>{if(!t||t<=0)return[];if(!T(t))return console.error("Times argument must be a number"),[];const n=[];for(let o=0;o<t;o++){const t=a(e)?e():r?ne(e):e;n.push(t)}return n},e.resetLogs=()=>{Oe=void 0,be="log",je="type"},e.reverseStr=z,e.runSeq=async(e=[],t={})=>{const[n]=r({asyncFns:e},{asyncFns:i});if(!n)return[];const{cloneResults:o=!1,returnOriginal:s=!0}=t,u=[];for(const t of e){const e=a(t)?await t(u.length,o?ne(u):u):s?t:void 0;u.push(e)}return u},e.sanitize=N,e.sanitizeCopy=e=>JSON.parse(N(JSON.stringify(e))),e.set=pe,e.setLogs=(e,t,r)=>{Oe=e,be=t||be||"log",je=r||je||"type"},e.shallowEqual=(e,t,r)=>{if(r&&(i(r)||b(r))&&(e=k(e,r),t=k(t,r)),e===t)return!0;if(!(e&&D(e)&&t&&D(t)))return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0},e.singular=e=>e&&e.length&&"s"===e[e.length-1]?e.slice(0,e.length-1):e,e.snakeCase=e=>A(e,"_").toLowerCase(),e.softFalsy=K,e.someEntry=(e,t)=>e?l(e)?a(t)?O(e,Object.entries,(e=>e.some((([e,r])=>t(e,r))))):(console.error(`Argument 'predicate' passed into someEntry must a function. Found: ${t}`),!1):(console.error(`Argument obj ${e} must be an object.`),!1):(console.error(`someEntry expects argument obj [${e}] to be defined.`),!1),e.spaceJoin=(e,t)=>(t=i(t)?t:[t]).reduce(((e,t)=>b(t)?`${e?e+" ":""}${t}`.trim():e),b(e)?e:""),e.strToType=he,e.styleCase=e=>{if(!b(e))return e;const t=C(e);return`${t[0].toLowerCase()}${t.slice(1)}`},e.template=M,e.throttle=(e,t=100)=>{let r=!1;return function(...n){if(!r)return r=!0,e.apply(this,n),setTimeout((()=>{r=!1}),t)}},e.throttleLast=(e,t,r=100)=>{let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>{e.apply(this,o),clearTimeout(n)}),r),"function"==typeof t&&t()}},e.timedRun=async(e,...t)=>{const[n]=r({fn:e},{fn:a});if(!n)return[void 0,-1];const o=new Date;return[await e(...t),new Date-o]},e.toBool=X,e.toFloat=e=>e&&!L(e)&&parseFloat(T(e)&&e||Q(e))||0,e.toInt=e=>e&&!L(e)&&parseInt(T(e)&&e||Q(e))||0,e.toNum=V,e.toObj=(e,t,r)=>i(e)?Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),{}):b(str)?(t=t||"=",r=r||"&",str.split(r).reduce(((e,r)=>{const n=r.split(t);return e[n[0].trim()]=he(n[1].trim()),e}),{})):{},e.toStr=x,e.trainCase=e=>b(e)&&e.split(/(?=[A-Z])|[\s_-]/gm).join("-").toLowerCase()||e,e.trimStringFields=e=>Object.entries(e).reduce(((e,[t,r])=>(e[t]=b(r)?r.trim():r,e)),e),e.typeOf=ie,e.uniqArr=(e,t)=>{if(!t)return ae(e);const{unique:r}=e.reduce(((e,r)=>{const n=t(r);return!e.set.has(n)&&e.unique.push(r),e.set.add(n),e}),{unique:[],set:new Set});return r},e.uniqArrByReference=ae,e.unset=(e,t)=>U(e,t,"unset"),e.uuid=se,e.validFilename=e=>{if(!e)return!1;return!(/[<>:"/\\|?*\u0000-\u001F]/g.test(e)||/^(con|prn|aux|nul|com\d|lpt\d)$/i.test(e)||/^\.\.?$/.test(e))},e.validate=r,e.wait=e=>new Promise((t=>setTimeout((()=>t(!0)),e))),e.wordCaps=e=>{if(!b(e))return e;return _(e).split(" ").map((e=>e&&$(e)||"")).join(" ")}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsutils={})}(this,(function(e){"use strict";const t={SHOULD_LOG:!0,SHOULD_THROW:!1,LOG_PREFIX:null},r=()=>!0,n=(e,n={},i={})=>{const{logs:u=t.SHOULD_LOG,throws:l=t.SHOULD_THROW,prefix:c=t.LOG_PREFIX}=i,a=Object.entries(e).map((([e,t])=>o(e,t,n[e]||n.$default||r))),{success:f,cases:p}=a.reduce(((e,t)=>s(e,t,{logs:u,throws:l,prefix:c})),{success:!0,cases:{}});return[f,p]};n.setOptions=({logs:e,throws:r,prefix:n})=>{void 0!==e&&(t.SHOULD_LOG=e),void 0!==r&&(t.SHOULD_THROW=r),void 0!==n&&(t.LOG_PREFIX=n)},n.resetOptions=()=>{t.SHOULD_LOG=!0,t.SHOULD_THROW=!1,t.LOG_PREFIX=null};const o=(e,t,r)=>{const n=r(t),o=!r.name||r.name===e||"$default"===r.name?r.toString():r.name;return{success:n,key:e,value:t,validator:r,reason:n?null:[`Argument "${e}" with value `,t,` failed validator: ${o}.`]}},s=(e,t,{logs:r,throws:n,prefix:o})=>(!t.success&&i(t,r,n,o),{success:e.success&&t.success,cases:{...e.cases,[t.key]:t}}),i=(e,t,r,n)=>{const o=n?[n,...e.reason]:e.reason;if(r)throw new Error(o.join());t&&console.error(...o)},u=e=>Array.isArray(e),l=e=>{const t=new Map;for(let n=0;n<e.length;n++){var r;const o=e[n],s=null!==(r=t.get(o))&&void 0!==r?r:0;t.set(o,s+1)}return t},c=(e,t)=>{if(e.size!==t.size)return!1;for(let[r,n]of e){if(t.get(r)!==n)return!1}return!0},a=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,f=e=>"function"==typeof e,p=e=>(Object.freeze(e),Object.getOwnPropertyNames(e).map((t=>{e.hasOwnProperty(t)&&null!==e[t]&&("object"==typeof e[t]||f(e[t]))&&!Object.isFrozen(e[t])&&p(e[t])})),e),d=Object.freeze({}),g=p({content:{}}),m=p([]),y=e=>e==e&&null!=e,h=(e,t,r)=>{for(let n=0;n<e.length;n++){const o=e[n];u(o)?h(o,t,r):r.exists&&!y(o)||r.truthy&&!o||t.push(o)}return r.mutate?(Object.assign(e,t).splice(t.length),e):t},O=(e,t)=>{if(u(t)){const[r,...n]=t;return r(e,...n)}return f(t)?t(e):(console.error("Pipeline expected either a function or an array (for function expressions). Found "+typeof t),e)},b=(e,...t)=>t.reduce(((e,t)=>O(e,t)),e),j=e=>"string"==typeof e,w=(e,t)=>{if(!j(e))return e;if(!f(t))return e;let r="";for(const n of e)r+=t(n);return r},S=e=>e===e.toLowerCase(),A=e=>e===e.toUpperCase(),$=(e,t,r=["-","_"," "])=>{if(!j(e))return e;const n=e=>r.some((t=>t===e));let o="_";return w(e,(e=>n(e)?(o=t,t):A(e)&&S(o)&&!n(o)?(o=e,t+e):(o=e,e)))},v=(e,t=!0)=>{if(!j(e)||!e[0])return e;const r=t?e.slice(1).toLowerCase():e.slice(1);return`${e[0].toUpperCase()}${r}`},_=e=>{const t=0===e.indexOf(".")?e.slice(1):e;return t.indexOf(".")===t.length-1?t.slice(0,-1):t},C=e=>e&&_(e).replace(/[-_]/gm," ")||e,x=(e,t)=>e&&C(e).split(/[\s_-]/gm).reduce(((e,r,n)=>r?e+=(n>0||t)&&v(r)||r.toLowerCase():e),"")||e,E=e=>null==e?"":j(e)?e:JSON.stringify(e),F=/[A-Z]/g,P=/^ms-/,R={},L=e=>"-"+e.toLowerCase(),T=e=>"number"==typeof e&&e!=e,I=e=>"number"==typeof e&&!T(e),N=e=>I(e)&&e>=0,D=e=>j(e)&&e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")||e,U=e=>"object"==typeof e&&null!==e,k=(e,t,r,n)=>{const o=e;if(!U(e)||!e||!t)return"set"!==r&&n||void 0;const s=u(t)?Array.from(t):t.split("."),i=s.pop();let l,c;for(;l=s.shift();){const t=e[l];if(U(t)||f(t)?e=t:("set"===r?e[l]={}:c=!0,e=e[l]),c)return n}return"get"===r?i in e?e[i]:n:"unset"===r?delete e[i]:(e[i]=n)&&o||o},M=(e,t,r)=>k(e,t,"get",r),q=(e,t,r="")=>{t=U(t)&&t||{};const n=q.regex||/\${(.*?)\}/g;return j(e)?e.replace(n,((e,n)=>{const o=(n||e.substr(2,e.length-3)).trim(),s=M(t,o,r);return f(s)?s(t,o,r):s})):console.error("template requires a string as the first argument")||e},z=['"',"'"],J=e=>{if(!j(e))return;let t="";for(let r of e)t=r+t;return t},B=(e,t,r)=>r.map((r=>e.indexOf(r,t))).sort().find((e=>e>=0)),H=(e,t,r=[" "])=>{const n=B(e,t,r);return e.substring(t,-1===n?e.length:n)},G=e=>"boolean"==typeof e,W=e=>"false"===e||"true"===e,K=e=>G(e)?E(e):e&&"false"!==e&&"0"!==e?"true":"false",X=e=>Boolean(e||""===e||0===e),Q=e=>W(e)?"true"===e:"true"===K(e),V=e=>E(e).replace(/([^.\d])/gm,""),Z=e=>I(e)?e:e&&!T(e)&&Number(V(e))||0,Y=e=>j(e)||I(e)||G(e),ee=(e,t)=>{const[r]=n({x:e,y:t},{$default:Y});return r?j(e)?e.localeCompare(t):e-t:null},te=e=>e,re=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ne=e=>{const t=function(...r){return e instanceof t||M(e.prototype,"constructor.name")?new e(...r):e.apply(e,r)};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return Object.defineProperty(t,"name",{value:e.name,configurable:!0}),t.toString=()=>e.toString(),t},oe=(e,t=new WeakMap)=>{if(Object(e)!==e)return e;if(e instanceof Set)return new Set(e);if(t.has(e))return t.get(e);if(u(e))return e.map((e=>oe(e)));if(f(e))return ne(e);const r=e instanceof Date?new Date(e):e instanceof RegExp?new RegExp(e.source,e.flags):e.constructor?null:Object.create(null);return null===r?se(e):(t.set(e,r),e instanceof Map?Array.from(e,(([e,n])=>r.set(e,oe(n,t)))):Object.assign(r,...Object.keys(e).map((r=>({[r]:oe(e[r],t)})))))},se=e=>{if(!e)return e;const t=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptors(e);for(const[e,t]of Object.entries(r))t.value&&(r[e].value=oe(t.value));const n=Object.create(t,r);return Object.isFrozen(e)&&Object.freeze(n),Object.isSealed(e)&&Object.seal(n),n},ie=e=>e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,ie),ue=e=>Object.prototype.toString.call(e).slice(8,-1),le=(e,...t)=>{if(!t.length)return null;for(let r of t){if(!u(r)){console.error(`Matching case must be an entry (a 2-element array). Found: ${ue(r)}`,r);break}const[t,n]=r;if(f(t)&&t(e))return n;if(t===e)return n}return null};le.default=()=>!0;const ce=e=>a(e)?0===Object.keys(e).length:u(e)?0===e.length:j(e)?0===e.trim().length:!!I(e)&&e<1,ae=(e,t)=>{const[r]=n({arr:e,comparator:t},{arr:u,$default:f});return r&&e.length?e.reduce(((e,r)=>t(e,r)>0?e:r)):null},fe=e=>u(e)?e.filter(((e,t,r)=>r.indexOf(e)==t)):e,pe=(e,t=!0)=>U(e)?Object.keys(e).reduce(((r,n)=>{const o=e[n];return null==o||(r[n]=t&&U(o)?pe(o):o),r}),a(e)&&{}||[]):console.error("cleanColl requires a collection as the first argument")||e,de=(e,t,r)=>k(e,t,"set",r),ge=Array.isArray,me=Object.keys,ye=Object.prototype.hasOwnProperty,he=(e,t)=>{if(e===t)return!0;if(!e||!t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;const r=ge(e),n=ge(t);let o,s,i;if(r&&n){if(s=e.length,s!=t.length)return!1;for(o=s;0!=o--;)if(!he(e[o],t[o]))return!1;return!0}if(r!=n)return!1;const u=e instanceof Date,l=t instanceof Date;if(u!=l)return!1;if(u&&l)return e.getTime()==t.getTime();const c=e instanceof RegExp,a=t instanceof RegExp;if(c!=a)return!1;if(c&&a)return e.toString()==t.toString();const f=me(e);if(s=f.length,s!==me(t).length)return!1;for(o=s;0!=o--;)if(!ye.call(t,f[o]))return!1;for(o=s;0!=o--;)if(i=f[o],!he(e[i],t[i]))return!1;return!0},Oe=e=>e&&j(e)?W(e)?Q(e):I(e)?Z(e):(()=>{try{return JSON.parse(e)}catch(t){return e}})():e;let be,je="dir",we="type";const Se=["error","info","log","dir","warn"],Ae=(...e)=>{if(!e.length)return;let t=1===e.length?je:e.pop();(be||"error"===t)&&("string"==typeof e[0]&&("type"===we?e[0]=`[ ${t.toUpperCase()} ] ${e[0]}`:we&&(e[0]=`${we} ${e[0]}`)),-1!==Se.indexOf(t)?console[t](...e):console[je](...e,t))},$e=(e,t)=>{e&&Object.entries(e).map((([r,n])=>{t&&-1!==t.indexOf(r)||("object"==typeof n&&$e(n),e[r]=void 0,delete e[r])}))},ve=(...e)=>e.reduce(((e,t)=>{const r=oe(t);return u(r)?[...u(e)&&e||[],...r]:a(r)?Object.entries(r).reduce(((e,[t,r])=>({...e,[t]:f(r)?ne(r):U(r)&&t in e?ve(e[t],r):oe(r)})),e):e}),u(e[0])&&[]||{}),_e=e=>u(e)&&2===e.length&&(I(e[0])||j(e[0])),Ce=(e,t)=>{if(!u(e)&&!a(e))return console.error(e,"Expected array or object for obj. Found "+typeof e),e;if(!f(t))return console.error("Expected function for cb. Found "+typeof t),e;const r=Object.entries(e),n=u(e)?[]:{};return r.reduce(((e,[r,n])=>{const o=t(r,n);return _e(o)?de(e,o[0],o[1]):(console.error(`Callback function must return entry. Found: ${o}. Using current entry instead.`),de(e,r,n))}),n)},xe=(e,t,r={})=>a(e)&&f(t)&&Object.entries(e).reduce(((e,[r,n])=>t(r,n,e)),r)||r,Ee=e=>{if(!f(e))throw"Argument must be a function";return(...t)=>new Promise(((r,n)=>f(t[t.length-1])?(t.pop(),t.push(((...e)=>e&&e[0]?n(...e):r(...e))),e(...t)):r(e(...t))))},Fe=Array.from(["caller","callee","arguments","apply","bind","call","toString","__proto__","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString"]).concat(Object.getOwnPropertyNames(Object.prototype)).reduce(((e,t)=>(e[t]=!0,e)),{}),Pe=e=>{if(!e.__IS_PROMISIFIED__){for(const t of Object.getOwnPropertyNames(e)){if(!(-1!==t.indexOf("Async")||e[`${t}Async`])&&!Fe[t])if(f(e[t]))e[`${t}Async`]=Ee(e[t]);else{const r=Object.getOwnPropertyDescriptor(e,t).get;f(r)&&(e[`${t}Async`]=Ee(r))}}e.__IS_PROMISIFIED__=!0}return e},Re=e=>Boolean(e&&e instanceof RegExp),Le=e=>Re(e)?e.source:j(e)?e:null,Te=e=>{const t={},r=e.split("?"),n=r[r.length-1];if(!n)return t;const o=n.split("&");return o.length&&o.map((e=>{const r=e.split("=");if(r.length<=1)return t;const n=[r.shift(),r.join("=")];if(2===n.length){const e=decodeURIComponent(n[1]).split(",");if(e&&e.length>1)t[n[0]]=e;else if(n[0]in t){const e=t[n[0]];t[n[0]]=u(e)?e.push(decodeURIComponent(n[1])):[e,decodeURIComponent(n[1])]}else t[n[0]]=decodeURIComponent(n[1])}})),t};e.applyToCloneOf=(e,t)=>{let r;if(e||(r="object (Argument 1) in applyToCloneOf, must be defined!"),a(e)||(r="object (Argument 1) in applyToCloneOf, must be an object!"),t||(r="mutator (Argument 2) in applyToCloneOf, must be defined!"),f(t)||(r="mutator (Argument 2) arg in applyToCloneOf, must be a function!"),r)return console.warn(r)||e;const n=oe(e);return t(n),n},e.applyToFunc=O,e.areCountMapsEqual=c,e.areFrequencyEqual=(e,t)=>{const[r]=n({arr:e,otherArr:t},{$default:u});if(!r)return null;if(e===t)return!0;if(e.length!==t.length)return!1;const o=l(e),s=l(t);return c(o,s)},e.areSetEqual=(e,t)=>{const[r]=n({arr:e,otherArr:t},{$default:u});if(!r)return null;if(e===t)return!0;const[o,s]=e.length>t.length?[e,t]:[t,e],i=new Set(s);for(let e=0;e<o.length;e++){const t=o[e];if(!i.has(t))return!1}return!0},e.buildElementCountMap=l,e.buildPath=(...e)=>e.reduce(((e,t)=>{let r=toStr(t);return`${e}${r&&"/"+r||""}`}),"").replace(/([^:\/]|^)\/{2,}/g,"$1/"),e.camelCase=x,e.camelCasePath=e=>{const t=e.split(".").map(((e,t)=>t>0?v(e,!1):e));return t.length>1?t.join(""):e},e.capitalize=v,e.checkCall=(e,...t)=>f(e)?e(...t):void 0,e.cleanColl=pe,e.cleanStr=C,e.clearObj=$e,e.cloneArr=e=>Array.from([...u(e)&&e||a(e)&&Object.entries(e)||[]]),e.cloneFunc=ne,e.cloneJson=e=>{try{return JSON.parse(JSON.stringify(e))}catch(e){return Ae(e.message,"error"),null}},e.cloneObjWithPrototypeAndProperties=se,e.compareTo=ee,e.complement=e=>{const[t]=n({predicate:e},{predicate:f});return t?(...t)=>!e(...t):null},e.containsStr=(e,t,r)=>(e=!j(e)&&E(e)||e,t=!j(t)&&E(t)||t,-1!==e.indexOf(t,r)),e.convertToStrBool=K,e.debounce=(e,t=250,r=!1)=>{let n;return function(...o){if(!f(e))return null;const s=this,i=r&&!n;return clearTimeout(n),n=setTimeout((()=>{n=null,!r&&e.apply(s,o)}),t),i?f(e)&&e.apply(s,o):void 0}},e.deepClone=oe,e.deepEqual=he,e.deepFreeze=p,e.deepMerge=ve,e.delimitString=$,e.doIt=(...e)=>{const t=e.slice(),r=t.shift(),n=t.shift(),o=t.pop();if(!I(r)||!f(o))return[];const s=new Array(r),i=[];for(let e=0;e<s.length;e++){const r=o.call(n,e,...t);if(!1===r)break;i.push(r)}return i},e.either=(e,t,r)=>f(r)?r(e,t)&&e||t:X(e)&&e||t,e.eitherArr=(e,t)=>u(e)?e:t,e.eitherFunc=(e,t)=>f(e)&&e||t,e.eitherObj=(e,t)=>a(e)&&e||t,e.eitherStr=(e,t)=>j(e)&&e||t,e.ensureArr=e=>u(e)?e:[e],e.equalsNaN=T,e.everyEntry=(e,t)=>e?a(e)?f(t)?b(e,Object.entries,(e=>e.every((([e,r])=>t(e,r))))):(console.error(`Argument 'predicate' passed into everyEntry must a function. Found: ${t}`),!1):(console.error(`Argument obj ${e} must be an object.`),!1):(console.error(`everyEntry expects argument obj [${e}] to be defined.`),!1),e.exists=y,e.filterObj=(e,t)=>e?a(e)?f(t)?xe(e,((e,r,n)=>(t(e,r)&&(n[e]=r),n)),{}):(console.error(`Argument 'predicate' passed into filterObject must a function. Found: ${t}`),e):(console.error(`Object ${e} was not an object. It must be for filterObject`),e):e,e.findExtrema=ae,e.findMax=(e=[],t=te)=>ae(e,((e,r)=>ee(t(e),t(r)))),e.findMin=(e=[],t=te)=>ae(e,((e,r)=>ee(t(r),t(e)))),e.flatArr=(e,t)=>h(e,[],a(t)?t:d),e.flatMap=(e,t)=>{const[r]=n({arr:e,mapFn:t},{arr:u,mapFn:f});return r?e.reduce(((e,r)=>{const n=t(r);return u(n)?n.map((t=>e.push(t))):e.push(n),e}),[]):e},e.get=M,e.getNearestDelimiterIndex=B,e.getNums=V,e.getRegexSource=Le,e.getURLParam=e=>{var t,r,o;const[s]=n({paramKey:e},{paramKey:j});if(!s)return null;const i="undefined"!=typeof document?document:null,u=null==i||null===(t=i.location)||void 0===t?void 0:t.search;return j(u)&&null!==(r=null===(o=Te(u))||void 0===o?void 0:o[e])&&void 0!==r?r:null},e.getWordEndingAt=(e,t,r=[" "])=>{const n=J(e),o=e.length-t;return J(H(n,o,r))},e.getWordStartingAt=H,e.hasDomAccess=()=>{try{return!("undefined"==typeof window||!window.document||!window.document.createElement)}catch(e){return!1}},e.hasOwn=re,e.hashString=(e,t)=>{if(!j(e)||0==e.length)return 0;e=e.split("").reverse().join("");let r=0;for(let t=0;t<e.length;t++){r=(r<<5)-r+e.charCodeAt(t),r=`${Math.abs(r&r)}`}return N(t)?r.slice(0,t):r},e.hyphenator=e=>{if(R.hasOwnProperty(e))return R[e];const t=e.replace(F,L);return R[e]=P.test(t)?"-"+t:t},e.identity=te,e.isArr=u,e.isArrMap=e=>{if(!a(e))return!1;const t=Object.values(e);return Q(t.length&&t.every(u))},e.isBool=G,e.isColl=U,e.isEmail=e=>{if(!e||!j(e))return!1;return Boolean(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(e))},e.isEmpty=ce,e.isEmptyColl=e=>u(e)?0===e.length:U(e)&&0===Object.getOwnPropertyNames(e).length,e.isEntry=_e,e.isFloat=e=>I(e)&&e%1!=0,e.isFunc=f,e.isInt=e=>I(e)&&e%1==0,e.isLowerCase=S,e.isNegative=e=>I(e)&&e<0,e.isNonNegative=N,e.isNum=I,e.isObj=a,e.isOrderable=Y,e.isPhone=e=>{if(!e||!j(e))return!1;return Boolean(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test(e))&&e.replace(/\D/g,"").length<11},e.isPositive=e=>I(e)&&e>0,e.isQuoted=(e,t=z)=>j(e)&&t.some((t=>e.startsWith(t)&&e.endsWith(t))),e.isRegex=Re,e.isSame=(e,t)=>e===t?0!==e||1/e==1/t:e!=e&&t!=t,e.isStr=j,e.isStrBool=W,e.isUpperCase=A,e.isUrl=e=>Boolean(/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)),e.isUuid=e=>{if(!e||!j(e))return!1;return Boolean(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))},e.isValidDate=e=>!isNaN((e instanceof Date&&e||new Date(e)).getTime()),e.isValidUrl=e=>/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/.test(e),e.joinRegex=(...e)=>{const[t,r]=(e=>{if(u(e[0]))return[e[0],e[1]];const t=e[e.length-1],r=j(t)?t:void 0;return[r?e.splice(0,e.length-1):e,r]})(e),n=t.reduce(((e,t)=>{const r=Le(t);return r?""===e?r:`${e}|${r}`:e}),"");return new RegExp(`(${n})`,r)},e.jsonEqual=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(e){return!1}},e.keyMap=(e,t)=>u(e)&&e.reduce(((e,r)=>{if(!j(r))return e;const n=t&&r.toUpperCase()||r;return e[n]=n,e}),{})||{},e.limbo=e=>e&&f(e.then)?e.then((e=>[null,e])).catch((e=>[e,void 0])):[new Error("A promise or thenable is required as the first argument!"),null],e.logData=Ae,e.mapColl=(e,t)=>f(t)&&U(e)?Object.keys(e).map((r=>t(r,e[r],e))):u(e)?[]:{},e.mapEntries=Ce,e.mapFind=(e,t,r=y)=>{const[o]=n({coll:e,mapper:t,test:r},{coll:U,$default:f});if(o)return a(e)?((e,t,r)=>{let n=0;for(let o in e){if(!e.hasOwnProperty(o))continue;const s=t(e[o],o,n);if(r(s,o,n))return s;n++}return null})(e,t,r):((e,t,r)=>{for(let n=0;n<e.length;n++){const o=t(e[n],n,n);if(r(o,n,n))return o}return null})(e,t,r)},e.mapKeys=(e,t)=>a(e)&&f(t)?Ce(e,((e,r)=>[t(e),r])):e,e.mapObj=(e,t)=>a(e)&&f(t)&&Object.entries(e).map((([e,r])=>t(e,r)))||e,e.mapString=w,e.match=le,e.memorize=(e,t,r=1)=>{if(!f(e)||t&&!f(t))return console.error("Error: Expected a function",e,t);let n=function(){const o=n.cache,s=t?t.apply(this,arguments):arguments[0];if(re(o,s))return o[s];const i=e.apply(this,arguments);return I(r)&&Object.keys(o).length<r?o[s]=i:n.cache={[s]:i},i};return n.cache={},n.destroy=()=>{t=void 0,n.cache=void 0,n.destroy=void 0,n=void 0},n},e.mod=(e,t)=>(e%t+t)%t,e.noOp=()=>{},e.noOpObj=d,e.noPropArr=m,e.noPropObj=g,e.nth=e=>{if(!I(e)){if(!(e=V(e)))return"";if(e=Z(e),T(e))return""}const t=e%100;if(t>=10&&t<=20)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},e.objToQuery=e=>{let t;return xe(e,((e,r,n)=>{if(!r)return n;const o=j(r)||I(r)||G(r)?r:U(r)?u(r)?r.join(","):JSON.stringify(r):null;return o?(n=t?`${n}&${encodeURIComponent(e)}=${encodeURIComponent(o)}`:`?${encodeURIComponent(e)}=${encodeURIComponent(o)}`,t=!0,n):n}),"")},e.omitKeys=(e={},t=[])=>a(e)&&xe(e,((r,n,o)=>(-1===t.indexOf(r)&&(o[r]=e[r]),o)),{})||{},e.omitRange=(e,t,r)=>{const[o]=n({arr:e,startIndex:t,count:r},{arr:u,$default:N});if(!o)return e;const s=[...e];return s.splice(t,r),s},e.parseErrorMessage=e=>j(e)&&!ce(e)?e:a(e)?e.message:null,e.parseJSON=e=>{try{return JSON.parse(e)}catch(e){return console.error(e.message),null}},e.pickKeys=(e={},t=[])=>a(e)&&t.reduce(((t,r)=>(r in e&&(t[r]=e[r]),t)),{})||{},e.pipeline=b,e.plural=e=>e&&e.length&&"s"!==e[e.length-1]?e+"s":e,e.promisify=Ee,e.promisifyAll=e=>{if(!a(e))return e;Pe(e);const t=Object.getPrototypeOf(e);return t&&null!==Object.getPrototypeOf(t)&&Pe(t),e},e.queryToObj=Te,e.randomArr=(e,t)=>{if(!u(e))return e;const r=t||1,n=[];for(let t=0;t<r;t++)n.push(e[Math.floor(Math.random()*e.length)]);return t?n:n[0]},e.randomizeArr=e=>!u(e)&&e||e.sort((()=>.5-Math.random())),e.reduceColl=(e,t,r)=>f(t)&&U(e)?Object.keys(e).reduce(((r,n)=>t(n,e[n],e,r)),r):u(e)?[]:{},e.reduceObj=xe,e.removeDot=_,e.repeat=(e,t,r=!1)=>{if(!t||t<=0)return[];if(!I(t))return console.error("Times argument must be a number"),[];const n=[];for(let o=0;o<t;o++){const t=f(e)?e():r?oe(e):e;n.push(t)}return n},e.resetLogs=()=>{be=void 0,je="log",we="type"},e.reverseStr=J,e.runSeq=async(e=[],t={})=>{const[r]=n({asyncFns:e},{asyncFns:u});if(!r)return[];const{cloneResults:o=!1,returnOriginal:s=!0}=t,i=[];for(const t of e){const e=f(t)?await t(i.length,o?oe(i):i):s?t:void 0;i.push(e)}return i},e.sanitize=D,e.sanitizeCopy=e=>JSON.parse(D(JSON.stringify(e))),e.set=de,e.setLogs=(e,t,r)=>{be=e,je=t||je||"log",we=r||we||"type"},e.shallowEqual=(e,t,r)=>{if(r&&(u(r)||j(r))&&(e=M(e,r),t=M(t,r)),e===t)return!0;if(!(e&&U(e)&&t&&U(t)))return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0},e.singular=e=>e&&e.length&&"s"===e[e.length-1]?e.slice(0,e.length-1):e,e.snakeCase=e=>$(e,"_").toLowerCase(),e.softFalsy=X,e.someEntry=(e,t)=>e?a(e)?f(t)?b(e,Object.entries,(e=>e.some((([e,r])=>t(e,r))))):(console.error(`Argument 'predicate' passed into someEntry must a function. Found: ${t}`),!1):(console.error(`Argument obj ${e} must be an object.`),!1):(console.error(`someEntry expects argument obj [${e}] to be defined.`),!1),e.spaceJoin=(e,t)=>(t=u(t)?t:[t]).reduce(((e,t)=>j(t)?`${e?e+" ":""}${t}`.trim():e),j(e)?e:""),e.strToType=Oe,e.styleCase=e=>{if(!j(e))return e;const t=x(e);return`${t[0].toLowerCase()}${t.slice(1)}`},e.template=q,e.throttle=(e,t=100)=>{let r=!1;return function(...n){if(!r)return r=!0,e.apply(this,n),setTimeout((()=>{r=!1}),t)}},e.throttleLast=(e,t,r=100)=>{let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>{e.apply(this,o),clearTimeout(n)}),r),"function"==typeof t&&t()}},e.timedRun=async(e,...t)=>{const[r]=n({fn:e},{fn:f});if(!r)return[void 0,-1];const o=new Date;return[await e(...t),new Date-o]},e.toBool=Q,e.toFloat=e=>e&&!T(e)&&parseFloat(I(e)&&e||V(e))||0,e.toInt=e=>e&&!T(e)&&parseInt(I(e)&&e||V(e))||0,e.toNum=Z,e.toObj=(e,t,r)=>u(e)?Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),{}):j(str)?(t=t||"=",r=r||"&",str.split(r).reduce(((e,r)=>{const n=r.split(t);return e[n[0].trim()]=Oe(n[1].trim()),e}),{})):{},e.toStr=E,e.trainCase=e=>j(e)&&e.split(/(?=[A-Z])|[\s_-]/gm).join("-").toLowerCase()||e,e.trimStringFields=e=>Object.entries(e).reduce(((e,[t,r])=>(e[t]=j(r)?r.trim():r,e)),e),e.typeOf=ue,e.uniqArr=(e,t)=>{if(!t)return fe(e);const{unique:r}=e.reduce(((e,r)=>{const n=t(r);return!e.set.has(n)&&e.unique.push(r),e.set.add(n),e}),{unique:[],set:new Set});return r},e.uniqArrByReference=fe,e.unset=(e,t)=>k(e,t,"unset"),e.uuid=ie,e.validFilename=e=>{if(!e)return!1;return!(/[<>:"/\\|?*\u0000-\u001F]/g.test(e)||/^(con|prn|aux|nul|com\d|lpt\d)$/i.test(e)||/^\.\.?$/.test(e))},e.validate=n,e.wait=e=>new Promise((t=>setTimeout((()=>t(!0)),e))),e.wordCaps=e=>{if(!j(e))return e;return C(e).split(" ").map((e=>e&&v(e)||"")).join(" ")}})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@keg-hub/jsutils", | ||
"version": "8.5.0", | ||
"version": "8.6.0", | ||
"description": "Keg common javascript utils", | ||
@@ -5,0 +5,0 @@ "main": "build/umd/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
702160
3726