@pluginjs/utils
Advanced tools
Comparing version 0.8.7 to 0.8.8
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
@@ -182,6 +182,7 @@ * Released under the GPL-3.0 License. | ||
} else if (is.isPlainObject(target) && is.isPlainObject(source)) { | ||
var newTarget = clone(target); | ||
Object.keys(source).forEach(key => { | ||
target[key] = deepMergeTwo(target[key], source[key]); | ||
newTarget[key] = deepMergeTwo(newTarget[key], source[key]); | ||
}); | ||
return target; | ||
return newTarget; | ||
} | ||
@@ -188,0 +189,0 @@ |
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@pluginjs/is");function e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function n(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var o=e=>{if(r.isElement(e))return e;if(r.isArray(e))return e.slice();if(r.isDate(e))return new e.constructor(Number(e));if(r.isMap(e))return new Map(e);if(r.isSet(e))return new Set(e);if(r.isSymbol(e))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(e)):{};if(r.isRegexp(e)){var t=new e.constructor(e.source,/\w+$/.exec(e));return t.lastIndex=e.lastIndex,t}return r.isError(e)?Object.create(e):r.isPlainObject(e)?Object.assign({},e):e},a=e=>r.isPlainObject(e)?i(e):r.isArray(e)?c(e):o(e),i=e=>{if(r.isPlainObject(e)){var t=new e.constructor;for(var n in e)t[n]=a(e[n]);return t}return e},c=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=a(r[t]);return e};function s(e,t){var n=r.isArray(t),a=r.isArray(e);return r.isUndefined(t)?e:n!==a||n?o(t):r.isPlainObject(e)&&r.isPlainObject(t)?(Object.keys(t).forEach((r=>{e[r]=s(e[r],t[r])})),e):o(t)}var u=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},l=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r.isArray(e[i])&&r.isArray(t[i])){if(!u(e[i],t[i]))return!1}else if(r.isObject(e[i])&&r.isObject(t[i])){if(!l(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0};exports.SvgElement=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},exports.arrayDiff=(r,e)=>r.filter((r=>e.indexOf(r)<0)),exports.arrayEqual=u,exports.arrayIntersect=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((r=>-1!==e.indexOf(r)))},exports.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},exports.clone=o,exports.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight(((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r)),t)};return n.currylen=e[e.curylen||e.length-1].length,n},exports.convertFloatToPercentage=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),exports.convertMatrixToArray=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),exports.convertPercentageToFloat=r=>parseFloat(r.slice(0,-1)/100,10),exports.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t.concat(a);return c.length>=n?e(...c):r(e,c)}},exports.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=a.findIndex(t);if(c>=0){var s=n.concat(...a.slice(0,c+1));return e(...s)}var u=n.concat(...a);return r(e,t,u)}},exports.dasherize=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),exports.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t;e&&(clearTimeout(e),e=null),e=setTimeout((()=>{r.apply(c,a)}),n)}},exports.deepClone=a,exports.deepCloneArray=c,exports.deepCloneObject=i,exports.deepMerge=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(r.isObject).reduce(s,{})},exports.each=(e,t)=>{if(r.isArray(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map((r=>{var[e,n]=r;return t(e,n)}));return e},exports.fromPairs=function(r){return r.reduce(((r,e)=>{var[t,o]=e;return n(n({},r),{},{[t]:o})}),{})},exports.getTime=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),exports.getUID=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},exports.getValueByPath=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}},exports.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((e=>{for(var t in e)r[t]=e[t]})),r},exports.nub=r=>Array.from(new Set(r)),exports.objectEqual=l,exports.parseDataOptions=function(r){return Object.entries(r).reduce(((r,e)=>{var[t,o]=e;try{var a=JSON.parse('{"data": '.concat(o.replace(/'/g,'"'),"}")).data;return n(n({},r),{},{[t]:a})}catch(e){return n(n({},r),{},{[t]:o})}}),{})},exports.range=r=>Array.from({length:r},((r,e)=>e)),exports.reflow=r=>r.offsetHeight,exports.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,c=new Array(i),s=0;s<i;s++)c[s]=arguments[s];r.apply(a,c),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var c=t;n||(n=!0,window.requestAnimationFrame((()=>{r.apply(c,a),o()})))}},exports.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@pluginjs/is");function e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function n(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var o=e=>{if(r.isElement(e))return e;if(r.isArray(e))return e.slice();if(r.isDate(e))return new e.constructor(Number(e));if(r.isMap(e))return new Map(e);if(r.isSet(e))return new Set(e);if(r.isSymbol(e))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(e)):{};if(r.isRegexp(e)){var t=new e.constructor(e.source,/\w+$/.exec(e));return t.lastIndex=e.lastIndex,t}return r.isError(e)?Object.create(e):r.isPlainObject(e)?Object.assign({},e):e},a=e=>r.isPlainObject(e)?i(e):r.isArray(e)?c(e):o(e),i=e=>{if(r.isPlainObject(e)){var t=new e.constructor;for(var n in e)t[n]=a(e[n]);return t}return e},c=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=a(r[t]);return e};function u(e,t){var n=r.isArray(t),a=r.isArray(e);if(r.isUndefined(t))return e;if(n!==a)return o(t);if(n)return o(t);if(r.isPlainObject(e)&&r.isPlainObject(t)){var i=o(e);return Object.keys(t).forEach((r=>{i[r]=u(i[r],t[r])})),i}return o(t)}var s=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},l=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r.isArray(e[i])&&r.isArray(t[i])){if(!s(e[i],t[i]))return!1}else if(r.isObject(e[i])&&r.isObject(t[i])){if(!l(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0};exports.SvgElement=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},exports.arrayDiff=(r,e)=>r.filter((r=>e.indexOf(r)<0)),exports.arrayEqual=s,exports.arrayIntersect=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((r=>-1!==e.indexOf(r)))},exports.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},exports.clone=o,exports.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight(((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r)),t)};return n.currylen=e[e.curylen||e.length-1].length,n},exports.convertFloatToPercentage=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),exports.convertMatrixToArray=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),exports.convertPercentageToFloat=r=>parseFloat(r.slice(0,-1)/100,10),exports.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t.concat(a);return c.length>=n?e(...c):r(e,c)}},exports.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=a.findIndex(t);if(c>=0){var u=n.concat(...a.slice(0,c+1));return e(...u)}var s=n.concat(...a);return r(e,t,s)}},exports.dasherize=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),exports.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t;e&&(clearTimeout(e),e=null),e=setTimeout((()=>{r.apply(c,a)}),n)}},exports.deepClone=a,exports.deepCloneArray=c,exports.deepCloneObject=i,exports.deepMerge=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(r.isObject).reduce(u,{})},exports.each=(e,t)=>{if(r.isArray(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map((r=>{var[e,n]=r;return t(e,n)}));return e},exports.fromPairs=function(r){return r.reduce(((r,e)=>{var[t,o]=e;return n(n({},r),{},{[t]:o})}),{})},exports.getTime=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),exports.getUID=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},exports.getValueByPath=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}},exports.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((e=>{for(var t in e)r[t]=e[t]})),r},exports.nub=r=>Array.from(new Set(r)),exports.objectEqual=l,exports.parseDataOptions=function(r){return Object.entries(r).reduce(((r,e)=>{var[t,o]=e;try{var a=JSON.parse('{"data": '.concat(o.replace(/'/g,'"'),"}")).data;return n(n({},r),{},{[t]:a})}catch(e){return n(n({},r),{},{[t]:o})}}),{})},exports.range=r=>Array.from({length:r},((r,e)=>e)),exports.reflow=r=>r.offsetHeight,exports.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];r.apply(a,c),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var c=t;n||(n=!0,window.requestAnimationFrame((()=>{r.apply(c,a),o()})))}},exports.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}; |
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
@@ -178,6 +178,7 @@ * Released under the GPL-3.0 License. | ||
} else if (isPlainObject(target) && isPlainObject(source)) { | ||
var newTarget = clone(target); | ||
Object.keys(source).forEach(key => { | ||
target[key] = deepMergeTwo(target[key], source[key]); | ||
newTarget[key] = deepMergeTwo(newTarget[key], source[key]); | ||
}); | ||
return target; | ||
return newTarget; | ||
} | ||
@@ -184,0 +185,0 @@ |
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
import{isArray as r,isElement as e,isDate as t,isMap as n,isSet as o,isSymbol as a,isRegexp as i,isError as u,isPlainObject as c,isObject as f,isUndefined as l}from"@pluginjs/is";function v(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){v(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var p=r=>Array.from(new Set(r)),h=(e,t)=>{if(r(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map((r=>{var[e,n]=r;return t(e,n)}));return e};function w(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}var y=f=>{if(e(f))return f;if(r(f))return f.slice();if(t(f))return new f.constructor(Number(f));if(n(f))return new Map(f);if(o(f))return new Set(f);if(a(f))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(f)):{};if(i(f)){var l=new f.constructor(f.source,/\w+$/.exec(f));return l.lastIndex=f.lastIndex,l}return u(f)?Object.create(f):c(f)?Object.assign({},f):f},d=e=>c(e)?O(e):r(e)?b(e):y(e),O=r=>{if(c(r)){var e=new r.constructor;for(var t in r)e[t]=d(r[t]);return e}return r},b=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=d(r[t]);return e},m=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((e=>{for(var t in e)r[t]=e[t]})),r};function j(e,t){var n=r(t),o=r(e);return l(t)?e:n!==o||n?y(t):c(e)&&c(t)?(Object.keys(t).forEach((r=>{e[r]=j(e[r],t[r])})),e):y(t)}var A=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(f).reduce(j,{})},P=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t.concat(a);return u.length>=n?e(...u):r(e,u)}},E=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=a.findIndex(t);if(u>=0){var c=n.concat(...a.slice(0,u+1));return e(...c)}var f=n.concat(...a);return r(e,t,f)}},x=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight(((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r)),t)};return n.currylen=e[e.curylen||e.length-1].length,n},S=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},$=r=>Array.from({length:r},((r,e)=>e)),D=r=>r.offsetHeight,N=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},C=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r(e[i])&&r(t[i])){if(!N(e[i],t[i]))return!1}else if(f(e[i])&&f(t[i])){if(!C(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0},F=(r,e)=>r.filter((r=>e.indexOf(r)<0)),I=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((r=>-1!==e.indexOf(r)))},T=r=>parseFloat(r.slice(0,-1)/100,10),M=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),k=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),H=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),L=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},U=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),q=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}};function z(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];r.apply(a,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var u=t;n||(n=!0,window.requestAnimationFrame((()=>{r.apply(u,a),o()})))}}function B(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout((()=>{r.apply(u,a)}),n)}}function J(r){return r.reduce(((r,e)=>{var[t,n]=e;return g(g({},r),{},{[t]:n})}),{})}var R=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t};function Z(r){return Object.entries(r).reduce(((r,e)=>{var[t,n]=e;try{var o=JSON.parse('{"data": '.concat(n.replace(/'/g,'"'),"}")).data;return g(g({},r),{},{[t]:o})}catch(e){return g(g({},r),{},{[t]:n})}}),{})}export{R as SvgElement,F as arrayDiff,N as arrayEqual,I as arrayIntersect,L as camelize,y as clone,x as compose,M as convertFloatToPercentage,k as convertMatrixToArray,T as convertPercentageToFloat,P as curry,E as curryWith,U as dasherize,B as debounce,d as deepClone,b as deepCloneArray,O as deepCloneObject,A as deepMerge,h as each,J as fromPairs,H as getTime,S as getUID,q as getValueByPath,m as merge,p as nub,C as objectEqual,Z as parseDataOptions,$ as range,D as reflow,z as throttle,w as triggerNative}; | ||
import{isArray as r,isElement as e,isDate as t,isMap as n,isSet as o,isSymbol as a,isRegexp as i,isError as u,isPlainObject as c,isObject as f,isUndefined as l}from"@pluginjs/is";function v(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){v(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var p=r=>Array.from(new Set(r)),h=(e,t)=>{if(r(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map((r=>{var[e,n]=r;return t(e,n)}));return e};function w(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}var y=f=>{if(e(f))return f;if(r(f))return f.slice();if(t(f))return new f.constructor(Number(f));if(n(f))return new Map(f);if(o(f))return new Set(f);if(a(f))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(f)):{};if(i(f)){var l=new f.constructor(f.source,/\w+$/.exec(f));return l.lastIndex=f.lastIndex,l}return u(f)?Object.create(f):c(f)?Object.assign({},f):f},d=e=>c(e)?O(e):r(e)?b(e):y(e),O=r=>{if(c(r)){var e=new r.constructor;for(var t in r)e[t]=d(r[t]);return e}return r},b=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=d(r[t]);return e},m=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((e=>{for(var t in e)r[t]=e[t]})),r};function j(e,t){var n=r(t),o=r(e);if(l(t))return e;if(n!==o)return y(t);if(n)return y(t);if(c(e)&&c(t)){var a=y(e);return Object.keys(t).forEach((r=>{a[r]=j(a[r],t[r])})),a}return y(t)}var A=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(f).reduce(j,{})},P=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t.concat(a);return u.length>=n?e(...u):r(e,u)}},E=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=a.findIndex(t);if(u>=0){var c=n.concat(...a.slice(0,u+1));return e(...c)}var f=n.concat(...a);return r(e,t,f)}},x=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight(((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r)),t)};return n.currylen=e[e.curylen||e.length-1].length,n},S=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},$=r=>Array.from({length:r},((r,e)=>e)),D=r=>r.offsetHeight,N=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},C=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r(e[i])&&r(t[i])){if(!N(e[i],t[i]))return!1}else if(f(e[i])&&f(t[i])){if(!C(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0},F=(r,e)=>r.filter((r=>e.indexOf(r)<0)),I=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((r=>-1!==e.indexOf(r)))},T=r=>parseFloat(r.slice(0,-1)/100,10),M=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),k=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),H=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),L=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,((r,e)=>e.toUpperCase())),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},U=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),q=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}};function z(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];r.apply(a,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var u=t;n||(n=!0,window.requestAnimationFrame((()=>{r.apply(u,a),o()})))}}function B(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout((()=>{r.apply(u,a)}),n)}}function J(r){return r.reduce(((r,e)=>{var[t,n]=e;return g(g({},r),{},{[t]:n})}),{})}var R=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t};function Z(r){return Object.entries(r).reduce(((r,e)=>{var[t,n]=e;try{var o=JSON.parse('{"data": '.concat(n.replace(/'/g,'"'),"}")).data;return g(g({},r),{},{[t]:o})}catch(e){return g(g({},r),{},{[t]:n})}}),{})}export{R as SvgElement,F as arrayDiff,N as arrayEqual,I as arrayIntersect,L as camelize,y as clone,x as compose,M as convertFloatToPercentage,k as convertMatrixToArray,T as convertPercentageToFloat,P as curry,E as curryWith,U as dasherize,B as debounce,d as deepClone,b as deepCloneArray,O as deepCloneObject,A as deepMerge,h as each,J as fromPairs,H as getTime,S as getUID,q as getValueByPath,m as merge,p as nub,C as objectEqual,Z as parseDataOptions,$ as range,D as reflow,z as throttle,w as triggerNative}; |
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
@@ -257,6 +257,7 @@ * Released under the GPL-3.0 License. | ||
} else if (is.isPlainObject(target) && is.isPlainObject(source)) { | ||
var newTarget = clone(target); | ||
Object.keys(source).forEach(function (key) { | ||
target[key] = deepMergeTwo(target[key], source[key]); | ||
newTarget[key] = deepMergeTwo(newTarget[key], source[key]); | ||
}); | ||
return target; | ||
return newTarget; | ||
} | ||
@@ -263,0 +264,0 @@ |
/*! | ||
* @pluginjs/utils v0.8.7 (https://pluginjs.com) | ||
* @pluginjs/utils v0.8.8 (https://pluginjs.com) | ||
* Copyright 2021 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self)["@pluginjs/utils"]={},r["@pluginjs/is"])}(this,(function(r,e){"use strict";function t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function o(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?n(Object(o),!0).forEach((function(e){t(r,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function i(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(r)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){o=!0,i=r}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return t}(r,e)||u(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(r){return function(r){if(Array.isArray(r))return c(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||u(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,e){if(r){if("string"==typeof r)return c(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(r,e):void 0}}function c(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var f=function(r){if(e.isElement(r))return r;if(e.isArray(r))return r.slice();if(e.isDate(r))return new r.constructor(Number(r));if(e.isMap(r))return new Map(r);if(e.isSet(r))return new Set(r);if(e.isSymbol(r))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(r)):{};if(e.isRegexp(r)){var t=new r.constructor(r.source,/\w+$/.exec(r));return t.lastIndex=r.lastIndex,t}return e.isError(r)?Object.create(r):e.isPlainObject(r)?Object.assign({},r):r},l=function(r){return e.isPlainObject(r)?s(r):e.isArray(r)?p(r):f(r)},s=function(r){if(e.isPlainObject(r)){var t=new r.constructor;for(var n in r)t[n]=l(r[n]);return t}return r},p=function(r){for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=l(r[t]);return e};function y(r,t){var n=e.isArray(t),o=e.isArray(r);return e.isUndefined(t)?r:n!==o||n?f(t):e.isPlainObject(r)&&e.isPlainObject(t)?(Object.keys(t).forEach((function(e){r[e]=y(r[e],t[e])})),r):f(t)}var v=function(r,e){if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0};r.SvgElement=function(r,e){var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},r.arrayDiff=function(r,e){return r.filter((function(r){return e.indexOf(r)<0}))},r.arrayEqual=v,r.arrayIntersect=function(r,e){var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((function(r){return-1!==e.indexOf(r)}))},r.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(function(r,e){return e.toUpperCase()})),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},r.clone=f,r.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((function(r,t,n){return Array.isArray(r)&&n===e.length-1?t.apply(void 0,a(r)):t(r)}),t)};return n.currylen=e[e.curylen||e.length-1].length,n},r.convertFloatToPercentage=function(r){return r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")},r.convertMatrixToArray=function(r){return!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)},r.convertPercentageToFloat=function(r){return parseFloat(r.slice(0,-1)/100,10)},r.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var c=t.concat(i);return c.length>=n?e.apply(void 0,a(c)):r(e,c)}},r.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var c=i.findIndex(t);if(c>=0){var f=n.concat.apply(n,a(i.slice(0,c+1)));return e.apply(void 0,a(f))}var l=n.concat.apply(n,i);return r(e,t,l)}},r.dasherize=function(r){return r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()},r.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout((function(){r.apply(u,i)}),n)}},r.deepClone=l,r.deepCloneArray=p,r.deepCloneObject=s,r.deepMerge=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.filter(e.isObject).reduce(y,{})},r.each=function(r,t){if(e.isArray(r))for(var n=0,o=r.length;n<o;n++)t(r[n],n);else Object.entries(r).map((function(r){var e=i(r,2),n=e[0],o=e[1];return t(n,o)}));return r},r.fromPairs=function(r){return r.reduce((function(r,e){var n=i(e,2),a=n[0],u=n[1];return o(o({},r),{},t({},a,u))}),{})},r.getTime=function(){return void 0!==window.performance&&window.performance.now?window.performance.now():Date.now()},r.getUID=function(r){do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},r.getValueByPath=function(r,e){if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var i=t[o];"\\"===i[i.length-1];)i="".concat(i.slice(0,-1),".").concat(t[++o]);r=r[i]}return r}},r.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((function(e){for(var t in e)r[t]=e[t]})),r},r.nub=function(r){return Array.from(new Set(r))},r.objectEqual=function r(t,n){var o=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(n);if(o.length!==i.length)return!1;for(var a=0;a<o.length;a++){var u=o[a];if(e.isArray(t[u])&&e.isArray(n[u])){if(!v(t[u],n[u]))return!1}else if(e.isObject(t[u])&&e.isObject(n[u])){if(!r(t[u],n[u]))return!1}else if(t[u]!==n[u])return!1}return!0},r.parseDataOptions=function(r){return Object.entries(r).reduce((function(r,e){var n=i(e,2),a=n[0],u=n[1];try{var c=JSON.parse('{"data": '.concat(u.replace(/'/g,'"'),"}")).data;return o(o({},r),{},t({},a,c))}catch(e){return o(o({},r),{},t({},a,u))}}),{})},r.range=function(r){return Array.from({length:r},(function(r,e){return e}))},r.reflow=function(r){return r.offsetHeight},r.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var i=t;if(!n){n=!0;for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];r.apply(i,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var u=t;n||(n=!0,window.requestAnimationFrame((function(){r.apply(u,i),o()})))}},r.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)},Object.defineProperty(r,"__esModule",{value:!0})})); | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self)["@pluginjs/utils"]={},r["@pluginjs/is"])}(this,(function(r,e){"use strict";function t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function i(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){t(r,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}function o(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(r)))return;var t=[],n=!0,i=!1,o=void 0;try{for(var a,u=r[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){i=!0,o=r}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return t}(r,e)||u(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(r){return function(r){if(Array.isArray(r))return c(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||u(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,e){if(r){if("string"==typeof r)return c(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(r,e):void 0}}function c(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var f=function(r){if(e.isElement(r))return r;if(e.isArray(r))return r.slice();if(e.isDate(r))return new r.constructor(Number(r));if(e.isMap(r))return new Map(r);if(e.isSet(r))return new Set(r);if(e.isSymbol(r))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(r)):{};if(e.isRegexp(r)){var t=new r.constructor(r.source,/\w+$/.exec(r));return t.lastIndex=r.lastIndex,t}return e.isError(r)?Object.create(r):e.isPlainObject(r)?Object.assign({},r):r},l=function(r){return e.isPlainObject(r)?s(r):e.isArray(r)?p(r):f(r)},s=function(r){if(e.isPlainObject(r)){var t=new r.constructor;for(var n in r)t[n]=l(r[n]);return t}return r},p=function(r){for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=l(r[t]);return e};function y(r,t){var n=e.isArray(t),i=e.isArray(r);if(e.isUndefined(t))return r;if(n!==i)return f(t);if(n)return f(t);if(e.isPlainObject(r)&&e.isPlainObject(t)){var o=f(r);return Object.keys(t).forEach((function(r){o[r]=y(o[r],t[r])})),o}return f(t)}var v=function(r,e){if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0};r.SvgElement=function(r,e){var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},r.arrayDiff=function(r,e){return r.filter((function(r){return e.indexOf(r)<0}))},r.arrayEqual=v,r.arrayIntersect=function(r,e){var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((function(r){return-1!==e.indexOf(r)}))},r.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(function(r,e){return e.toUpperCase()})),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},r.clone=f,r.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((function(r,t,n){return Array.isArray(r)&&n===e.length-1?t.apply(void 0,a(r)):t(r)}),t)};return n.currylen=e[e.curylen||e.length-1].length,n},r.convertFloatToPercentage=function(r){return r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")},r.convertMatrixToArray=function(r){return!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)},r.convertPercentageToFloat=function(r){return parseFloat(r.slice(0,-1)/100,10)},r.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];var c=t.concat(o);return c.length>=n?e.apply(void 0,a(c)):r(e,c)}},r.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];var c=o.findIndex(t);if(c>=0){var f=n.concat.apply(n,a(o.slice(0,c+1)));return e.apply(void 0,a(f))}var l=n.concat.apply(n,o);return r(e,t,l)}},r.dasherize=function(r){return r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()},r.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout((function(){r.apply(u,o)}),n)}},r.deepClone=l,r.deepCloneArray=p,r.deepCloneObject=s,r.deepMerge=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.filter(e.isObject).reduce(y,{})},r.each=function(r,t){if(e.isArray(r))for(var n=0,i=r.length;n<i;n++)t(r[n],n);else Object.entries(r).map((function(r){var e=o(r,2),n=e[0],i=e[1];return t(n,i)}));return r},r.fromPairs=function(r){return r.reduce((function(r,e){var n=o(e,2),a=n[0],u=n[1];return i(i({},r),{},t({},a,u))}),{})},r.getTime=function(){return void 0!==window.performance&&window.performance.now?window.performance.now():Date.now()},r.getUID=function(r){do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},r.getValueByPath=function(r,e){if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var i=-1;r&&++i<n;){for(var o=t[i];"\\"===o[o.length-1];)o="".concat(o.slice(0,-1),".").concat(t[++i]);r=r[o]}return r}},r.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((function(e){for(var t in e)r[t]=e[t]})),r},r.nub=function(r){return Array.from(new Set(r))},r.objectEqual=function r(t,n){var i=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(n);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++){var u=i[a];if(e.isArray(t[u])&&e.isArray(n[u])){if(!v(t[u],n[u]))return!1}else if(e.isObject(t[u])&&e.isObject(n[u])){if(!r(t[u],n[u]))return!1}else if(t[u]!==n[u])return!1}return!0},r.parseDataOptions=function(r){return Object.entries(r).reduce((function(r,e){var n=o(e,2),a=n[0],u=n[1];try{var c=JSON.parse('{"data": '.concat(u.replace(/'/g,'"'),"}")).data;return i(i({},r),{},t({},a,c))}catch(e){return i(i({},r),{},t({},a,u))}}),{})},r.range=function(r){return Array.from({length:r},(function(r,e){return e}))},r.reflow=function(r){return r.offsetHeight},r.throttle=function(r,e){var t=this,n=!1;function i(){n=!1}return void 0!==e||null!==e?function(){var o=t;if(!n){n=!0;for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];r.apply(o,u),window.setTimeout(i,e)}}:function(){for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];var u=t;n||(n=!0,window.requestAnimationFrame((function(){r.apply(u,o),i()})))}},r.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)},Object.defineProperty(r,"__esModule",{value:!0})})); |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.8.7", | ||
"version": "0.8.8", | ||
"category": "utils", | ||
@@ -68,3 +68,3 @@ "main": "dist/utils.common.js", | ||
], | ||
"gitHead": "b0669d11c54fcb08d637b893f90ea375b8ef136c" | ||
"gitHead": "b3a9941966a6b7df1769d69b8c829cd859674814" | ||
} |
@@ -122,7 +122,8 @@ import { | ||
} else if (isPlainObject(target) && isPlainObject(source)) { | ||
const newTarget = clone(target) | ||
Object.keys(source).forEach(key => { | ||
target[key] = deepMergeTwo(target[key], source[key]) | ||
newTarget[key] = deepMergeTwo(newTarget[key], source[key]) | ||
}) | ||
return target | ||
return newTarget | ||
} | ||
@@ -129,0 +130,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80790
1859