New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

extes

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extes - npm Package Compare versions

Comparing version 4.1.2 to 4.2.0

107

dist/extes.js

@@ -649,9 +649,8 @@ (()=>{

}
if (Object(target) !== target) {
throw new TypeError("Argument 1 must be an object!");
var target_type = TypeOf(target);
if (target_type !== "Object") {
throw new TypeError("This api expects argument 1 to be a simple object! But receved " + target_type + "!");
}
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {
var source = sources_1[_a];
if (Object(source) !== source)
continue;
DeepMerge(target, source);

@@ -670,6 +669,3 @@ }

for (var key in source) {
var is_invalid = false;
is_invalid = (source.hasOwnProperty && !source.hasOwnProperty(key));
is_invalid = is_invalid || (source[key] === undefined);
if (is_invalid)
if (source[key] === undefined)
continue;

@@ -680,9 +676,4 @@ var tValue = target[key];

var sType = TypeOf(sValue);
if (tType !== "object" || sType !== "object") {
if (target instanceof Map) {
target.set(key, sValue);
}
else {
target[key] = sValue;
}
if (tType !== "Object" || sType !== "Object") {
target[key] = sValue;
continue;

@@ -693,85 +684,5 @@ }

}
function TypeOf(input, resolveObj) {
if (resolveObj === void 0) { resolveObj = false; }
var type = typeof input;
switch (type) {
case "number":
case "string":
case "function":
case "boolean":
case "undefined":
case "symbol":
return type;
}
if (input === null) {
return "null";
}
if (input instanceof String) {
return "string";
}
if (input instanceof Number) {
return "number";
}
if (input instanceof Boolean) {
return "boolean";
}
if (Array.isArray(input)) {
return "array";
}
if (!resolveObj) {
return "object";
}
// None-primitive
if (input instanceof ArrayBuffer) {
return "array-buffer";
}
if (input instanceof DataView) {
return "data-view";
}
if (input instanceof Uint8Array) {
return "uint8-array";
}
if (input instanceof Uint8ClampedArray) {
return "uint8-clamped-array";
}
if (input instanceof Int8Array) {
return "int8-array";
}
if (input instanceof Uint16Array) {
return "uint16-array";
}
if (input instanceof Int16Array) {
return "int16-array";
}
if (input instanceof Uint32Array) {
return "uint32-array";
}
if (input instanceof Int32Array) {
return "int32-array";
}
if (input instanceof Float32Array) {
return "float32-array";
}
if (input instanceof Float64Array) {
return "float64-array";
}
if (input instanceof Map) {
return "map";
}
if (input instanceof WeakMap) {
return "weak-map";
}
if (input instanceof Set) {
return "set";
}
if (input instanceof WeakSet) {
return "weak-set";
}
if (input instanceof RegExp) {
return "regexp";
}
if (input instanceof Promise) {
return "promise";
}
return "object";
function TypeOf(input) {
var result = Object.prototype.toString.call(input);
return result.substring(8, result.length - 1);
}

@@ -778,0 +689,0 @@ })();

2

dist/extes.min.js

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

(()=>{"use strict";var e,r,t,n,a,i,o=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function u(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,u)}l((n=n.apply(e,r||[])).next())}))},u=this&&this.__generator||function(e,r){var t,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=r.call(e,o)}catch(e){i=[6,e],n=0}finally{t=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},l=this&&this.__rest||function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t},f=this&&this.__spreadArray||function(e,r){for(var t=0,n=r.length,a=e.length;t<n;t++,a++)e[a]=r[t];return e},c=!0,s=!0,b=!1,p=function(){function e(){}return e.Padding=function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="0");for(var n=r-(e=""+e).length;n-- >0;)e=t+e;return e},e.ExtractBytes=function(e){return"undefined"!=typeof Buffer&&Buffer.isBuffer(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer):e instanceof ArrayBuffer?new Uint8Array(e):null},e.UTF8Encode=function(e){if("string"!=typeof e)throw new TypeError("Given input argument must be a js string!");for(var r=[],t=0;t<e.length;){var n=e.codePointAt(t);0==(4294967168&n)?r.push(n):0==(4294965248&n)?r.push(192|31&n>>6,128|63&n):0==(4294901760&n)?r.push(224|15&n>>12,128|63&n>>6,128|63&n):0==(4292870144&n)&&r.push(240|7&n>>18,128|63&n>>12,128|63&n>>6,128|63&n),t+=n>65535?2:1}return new Uint8Array(r)},e.UTF8Decode=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e instanceof Uint8Array))throw new TypeError("Given input must be an Uint8Array contains UTF8 encoded value!");for(var r=[],t=0;t<e.length;){var n=255&e[t];0==(128&n)?(r.push(n),t+=1):192==(224&n)?(n=(31&e[t])<<6|63&e[t+1],r.push(n),t+=2):224==(240&n)?(n=(15&e[t])<<12|(63&e[t+1])<<6|63&e[t+2],r.push(n),t+=3):240==(248&n)?(n=(7&e[t])<<18|(63&e[t+1])<<12|(63&e[t+2])<<6|63&e[t+3],r.push(n),t+=4):t+=1}for(var a="";r.length>0;){var i=r.splice(0,this.UTF8_DECODE_CHUNK_SIZE);a+=String.fromCodePoint.apply(String,i)}return a},e.UTF8_DECODE_CHUNK_SIZE=100,e}();e=/^(0x)?([0-9a-fA-F]+)$/,r=/^(0b|0B)?([01]+)$/,t="0123456789abcdef",n={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15},Object.defineProperty(ArrayBuffer.prototype,"bytes",{configurable:s,enumerable:b,get:function(){return new Uint8Array(this)}}),Object.defineProperty(Uint8Array,"from",{configurable:s,writable:c,enumerable:b,value:function(t,a){if(Array.isArray(t))return new Uint8Array(t);if("string"==typeof t){if("hex"===a||16===a){if(!(f=t.match(e)))throw new RangeError("Input argument is not a valid hex string!");var i=f[2];i=i.length%2==0?i.toLowerCase():"0"+i.toLowerCase();for(var o=new Uint8Array(i.length/2|0),u=0;u<o.length;u++){var l=2*u;o[u]=n[i[l]]<<4|15&n[i[l+1]]}return o}if("bits"===a||2===a){var f;if(!(f=t.match(r)))throw new RangeError("Input argument is not a valid bit string!");var c=f[2];for(c.length%8!=0&&(c="0".repeat(c.length%8)+c),o=new Uint8Array(c.length/8|0),u=0;u<o.length;u++){for(var s="1"===c[l=8*u]?1:0,b=1;b<8;b++)s=s<<1|("1"===c[l+b]?1:0);o[u]=s}return o}return p.UTF8Encode(t)}var g=p.ExtractBytes(t);if(!g)throw new TypeError("Cannot convert given input data into array buffer!");return g}}),Object.defineProperty(Uint8Array,"compare",{configurable:s,writable:c,enumerable:b,value:function(e,r){var t=p.ExtractBytes(e),n=p.ExtractBytes(r);if(!t||!n)throw new TypeError("Given arguments must be instances of ArrayBuffer, TypedArray or DataView!");for(var a=Math.max(t.length,n.length),i=0;i<a;i++){var o=t[i]||0,u=n[i]||0;if(o>u)return 1;if(o<u)return-1}return 0}}),Object.defineProperty(Uint8Array,"dump",{configurable:s,writable:c,enumerable:b,value:function(e,r,n){void 0===r&&(r=16),void 0===n&&(n=!0);var a=p.ExtractBytes(e);if(null===a)throw new TypeError("Argument 1 expects an instance of ArrayBuffer, TypedArray or DataView!");var i="";switch(r){case 16:for(var o=0;o<a.length;o++){var u=a[o];i+=t[(240&u)>>>4]+t[15&u]}break;case 2:for(o=0;o<a.length;o++){u=a[o];for(var l=7;l>=0;l--)i+=u>>>l&1?"1":"0"}break;default:throw new RangeError("Unsupported numeric representation!")}return n?i:i.replace(/^0+/,"")}}),Object.defineProperty(Uint8Array,"concat",{configurable:s,writable:c,enumerable:b,value:function(e){if(!Array.isArray(e))throw new TypeError("Given argument must be an array of ArrayBuffer, TypedArray or DataView instances!");for(var r=0,t=[],n=0,a=e;n<a.length;n++){var i=a[n];if(null===(f=p.ExtractBytes(i)))throw new TypeError("Given argument must be an array of ArrayBuffer, TypedArray or DataView instances!");r+=f.length,t.push(f)}var o=new Uint8Array(r);r=0;for(var u=0,l=t;u<l.length;u++){var f=l[u];o.set(f,r),r+=f.length}return o}}),Object.defineProperty(Array.prototype,"unique",{writable:c,configurable:s,enumerable:b,value:function(){for(var e=new Set,r=0;r<this.length;r++){var t=this[r];e.add(t)}return Array.from(e)}}),Object.defineProperty(Array.prototype,"exclude",{writable:c,configurable:s,enumerable:b,value:function(e){Array.isArray(e)||(e=[e]);for(var r=[],t=0;t<this.length;t++){for(var n=this[t],a=!1,i=0,o=e;i<o.length;i++)if(n===o[i]){a=a||!0;break}a||r.push(n)}return r}}),Object.defineProperty(Date,"from",{writable:c,configurable:s,enumerable:b,value:function(e,r,t,n,a,i,o){if(0===arguments.length)throw new Error("Date.from expects at least one arguments!");try{return"string"==typeof e||1===arguments.length?new Date(e):2===arguments.length?new Date(e,r):3===arguments.length?new Date(e,r,t):4===arguments.length?new Date(e,r,t,n):5===arguments.length?new Date(e,r,t,n,a):6===arguments.length?new Date(e,r,t,n,a,i):new Date(e,r,t,n,a,i,o)}catch(e){return null}}}),Object.defineProperty(Date,"present",{configurable:s,enumerable:b,get:function(){return new Date}}),Object.defineProperty(Date,"unix",{writable:c,configurable:s,enumerable:b,value:function(){return Math.floor(Date.now()/1e3)}}),Object.defineProperty(Date,"zoneShift",{writable:c,configurable:s,enumerable:b,value:function(){return 6e4*(new Date).getTimezoneOffset()}}),Object.defineProperty(Date.prototype,"getUnixTime",{writable:c,configurable:s,enumerable:b,value:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"toLocaleISOString",{writable:c,configurable:s,enumerable:b,value:function(e){void 0===e&&(e=!1);var r,t=this.getTimezoneOffset();if(0===t)r="Z";else{var n=t>0?"-":"+";t=Math.abs(t);var a=Math.floor(t/60),i=t%60;r=n+p.Padding(a)+p.Padding(i)}var o=e?"."+p.Padding(this.getMilliseconds()%1e3,3):"";return this.getFullYear()+"-"+p.Padding(this.getMonth()+1)+"-"+p.Padding(this.getDate())+"T"+p.Padding(this.getHours())+":"+p.Padding(this.getMinutes())+":"+p.Padding(this.getSeconds())+o+r}}),Object.defineProperty(Date.prototype,"unix",{configurable:s,enumerable:b,get:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"time",{configurable:s,enumerable:b,get:function(){return this.getTime()}}),Object.defineProperty(Date.prototype,"zoneShift",{configurable:s,enumerable:b,get:function(){return 6e4*this.getTimezoneOffset()}}),"undefined"!=typeof Document&&Object.defineProperties(Document.prototype,{parseHTML:{configurable:s,writable:c,enumerable:b,value:function(e){var r=this.implementation.createHTMLDocument().body;r.innerHTML=e;var t=new DocumentFragment;if(0===r.children.length)return t;if(1===r.children.length){var n=r.children[0];return n.remove(),n}for(var a=0,i=Array.prototype.slice.call(r.children,0);a<i.length;a++){var o=i[a];t.appendChild(o)}return t}}}),"undefined"!=typeof Error&&Object.defineProperty(Error.prototype,"stack_trace",{get:function(){return this.stack?this.stack.split(/\r\n|\n/g).map((function(e){return e.trim()})):[]},enumerable:b,configurable:s}),"undefined"!=typeof EventTarget&&(Object.defineProperty(EventTarget.prototype,"on",{configurable:s,writable:c,enumerable:b,value:function(e,r){for(var t=[],n=0,a=e.split(",");n<a.length;n++){var i=a[n];i=i.trim(),t.indexOf(i)>=0||(t.push(i),this.addEventListener(i,r))}return this}}),Object.defineProperty(EventTarget.prototype,"off",{configurable:s,writable:c,enumerable:b,value:function(e,r){for(var t=0,n=e.split(",");t<n.length;t++){var a=n[t];a=a.trim(),this.removeEventListener(a,r)}return this}}),Object.defineProperty(EventTarget.prototype,"emit",{configurable:s,writable:c,enumerable:b,value:function(e,r){void 0===r&&(r={});var t=r.bubbles,n=r.cancelable,a=r.composed,i=l(r,["bubbles","cancelable","composed"]);if("string"==typeof e&&(e=new Event(e,{bubbles:!!t,cancelable:!!n,composed:!!a})),!(e instanceof Event))throw new TypeError("Argument 1 accepts only string or Event instance!");return Object.assign(e,i),this.dispatchEvent(e)}})),Object.defineProperty(Function,"sequential",{configurable:s,writable:c,enumerable:b,value:function(e,r,t){if(void 0===r&&(r=!1),void 0===t&&(t=!1),!Array.isArray(e))throw new TypeError("The first argument must be an array of functions!");return r=!!r,function(){for(var n=this,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var l=void 0,c={};if(r)return Promise.resolve().then((function(){return o(n,void 0,void 0,(function(){var r,n,i,o;return u(this,(function(u){switch(u.label){case 0:r=0,n=e,u.label=1;case 1:return r<n.length?"function"!=typeof(i=n[r])?(l=i,[3,3]):(o=t?f(f([],a),[l]):[l],[4,i.call.apply(i,f([c],o))]):[3,4];case 2:l=u.sent(),u.label=3;case 3:return r++,[3,1];case 4:return[2,l]}}))}))}));for(var s=0,b=e;s<b.length;s++){var p=b[s];if("function"==typeof p){var g=t?f(f([],a),[l]):[l];l=p.call.apply(p,f([c],g))}else l=p}return l}}}),function(){function e(t,n){for(var a in n){if(!(n.hasOwnProperty&&!n.hasOwnProperty(a)||void 0===n[a])){var i=t[a],o=n[a],u=r(i),l=r(o);"object"===u&&"object"===l?e(i,o):t instanceof Map?t.set(a,o):t[a]=o}}}function r(e,r){void 0===r&&(r=!1);var t=typeof e;switch(t){case"number":case"string":case"function":case"boolean":case"undefined":case"symbol":return t}return null===e?"null":e instanceof String?"string":e instanceof Number?"number":e instanceof Boolean?"boolean":Array.isArray(e)?"array":r?e instanceof ArrayBuffer?"array-buffer":e instanceof DataView?"data-view":e instanceof Uint8Array?"uint8-array":e instanceof Uint8ClampedArray?"uint8-clamped-array":e instanceof Int8Array?"int8-array":e instanceof Uint16Array?"uint16-array":e instanceof Int16Array?"int16-array":e instanceof Uint32Array?"uint32-array":e instanceof Int32Array?"int32-array":e instanceof Float32Array?"float32-array":e instanceof Float64Array?"float64-array":e instanceof Map?"map":e instanceof WeakMap?"weak-map":e instanceof Set?"set":e instanceof WeakSet?"weak-set":e instanceof RegExp?"regexp":e instanceof Promise?"promise":"object":"object"}Object.defineProperty(Object,"merge",{writable:c,configurable:s,enumerable:b,value:function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Object(r)!==r)throw new TypeError("Argument 1 must be an object!");for(var a=0,i=t;a<i.length;a++){var o=i[a];Object(o)===o&&e(r,o)}return r}}),Object.defineProperty(Object,"typeOf",{writable:c,configurable:s,enumerable:b,value:r})}(),Object.defineProperties(Promise,{wait:{writable:c,configurable:s,enumerable:b,value:function(e){return void 0===e&&(e=[]),Array.isArray(e)||(e=[e]),0===e.length?Promise.resolve([]):new Promise((function(r,t){for(var n=[],a=0,i=!0,o=function(o){var u={resolved:!0,seq:o,result:null};n.push(u),Promise.resolve(e[o]).then((function(e){i=(u.resolved=!0)&&i,u.result=e}),(function(e){i=(u.resolved=!1)&&i,u.result=e})).then((function(){a++,e.length===a&&(i?r:t)(n)}))},u=0;u<e.length;u++)o(u)}))}},create:{writable:c,configurable:s,enumerable:b,value:function(){var e=null,r=null,t=new Promise((function(t,n){e=t,r=n}));return t.resolve=e,t.reject=r,t.promise=t,t}},chain:{writable:c,configurable:s,enumerable:b,value:function(e){var r=Promise.resolve();return"function"!=typeof e?r:r.then(e)}}}),a=/(\w)(\w*)(\W*)/g,i=function(e,r,t,n){return""+r.toUpperCase()+t.toLowerCase()+n},Object.defineProperties(String.prototype,{charCount:{configurable:s,enumerable:b,get:function(){for(var e=0,r=0;e<this.length;)r++,e+=this.codePointAt(e)>65535?2:1;return r}},upperCase:{configurable:s,enumerable:b,get:function(){return this.toUpperCase()}},localeUpperCase:{configurable:s,enumerable:b,get:function(){return this.toLocaleUpperCase()}},lowerCase:{configurable:s,enumerable:b,get:function(){return this.toLowerCase()}},localeLowerCase:{configurable:s,enumerable:b,get:function(){return this.toLocaleLowerCase()}},toCamelCase:{configurable:s,enumerable:b,value:function(){return this.replace(a,i)}},camelCase:{configurable:s,enumerable:b,get:function(){return this.replace(a,i)}},pull:{configurable:s,enumerable:b,writable:c,value:function(e,r){if(void 0===e&&(e=""),void 0===r&&(r=!0),"string"!=typeof e)throw new TypeError("Given token must be a string");var t,n=this.length;return 0===n?["",""]:""===e?r?[this[0],this.substring(1)]:[this.substring(0,n-1),this[n-1]]:r?(t=this.indexOf(e,e.length))<0?[this.substring(0),""]:[this.substring(0,t),this.substring(t)]:(t=this.lastIndexOf(e))<0?["",this.substring(0)]:[this.substring(0,t),this.substring(t)]}},cutin:{configurable:s,enumerable:b,writable:c,value:function(e,r){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];e<0&&(e+=this.length),r<=0&&(r=0);var a=this.substring(0,e),i=this.substring(e+r);return a+t.join("")+i}}}),Object.defineProperties(String,{encodeRegExpString:{writable:c,configurable:s,enumerable:b,value:function(e){return void 0===e&&(e=""),e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},from:{writable:c,configurable:s,enumerable:b,value:function(e){if("string"==typeof e)return e;var r=p.ExtractBytes(e);return null!==r?p.UTF8Decode(r):""+e}}}),function(){function e(){var e=null,r=!1,t=null,n=function(n,i){void 0===i&&(i=0);for(var o=[],u=2;u<arguments.length;u++)o[u-2]=arguments[u];e={cb:n,delay:i,args:o},r||(t&&(clearTimeout(t),t=null),a())};return n.clear=function(){e=null,t&&(clearTimeout(t),t=null)},n;function a(){if(e){var n=e.cb,i=e.delay,o=e.args;t=setTimeout((function(){r=!0,Promise.resolve(n.apply(void 0,o)).then((function(){r=!1,t=null,a()}),(function(n){throw r=!1,t=null,e=null,n}))}),i),e=null}}}Object.defineProperty(setTimeout,"create",{writable:c,configurable:s,enumerable:b,value:e}),Object.defineProperty(setTimeout,"idle",{writable:c,configurable:s,enumerable:b,value:function(e){void 0===e&&(e=0);return new Promise((function(r){setTimeout(r,e)}))}}),Object.defineProperty(setInterval,"create",{writable:c,configurable:s,enumerable:b,value:function(){var r=this,t=e(),n=function(e,n){void 0===n&&(n=0);for(var a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];var l=function(){return o(r,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:t(l,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.apply(void 0,a)];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),t.clear(),r;case 4:return[2]}}))}))};t.apply(void 0,f([l,n],a))};return n.clear=function(){t.clear()},n}})}()})();
(()=>{"use strict";var e,r,t,n,a,i,o=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function u(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,u)}l((n=n.apply(e,r||[])).next())}))},u=this&&this.__generator||function(e,r){var t,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=r.call(e,o)}catch(e){i=[6,e],n=0}finally{t=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},l=this&&this.__rest||function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t},f=this&&this.__spreadArray||function(e,r){for(var t=0,n=r.length,a=e.length;t<n;t++,a++)e[a]=r[t];return e},c=!0,s=!0,b=!1,h=function(){function e(){}return e.Padding=function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="0");for(var n=r-(e=""+e).length;n-- >0;)e=t+e;return e},e.ExtractBytes=function(e){return"undefined"!=typeof Buffer&&Buffer.isBuffer(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer):e instanceof ArrayBuffer?new Uint8Array(e):null},e.UTF8Encode=function(e){if("string"!=typeof e)throw new TypeError("Given input argument must be a js string!");for(var r=[],t=0;t<e.length;){var n=e.codePointAt(t);0==(4294967168&n)?r.push(n):0==(4294965248&n)?r.push(192|31&n>>6,128|63&n):0==(4294901760&n)?r.push(224|15&n>>12,128|63&n>>6,128|63&n):0==(4292870144&n)&&r.push(240|7&n>>18,128|63&n>>12,128|63&n>>6,128|63&n),t+=n>65535?2:1}return new Uint8Array(r)},e.UTF8Decode=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e instanceof Uint8Array))throw new TypeError("Given input must be an Uint8Array contains UTF8 encoded value!");for(var r=[],t=0;t<e.length;){var n=255&e[t];0==(128&n)?(r.push(n),t+=1):192==(224&n)?(n=(31&e[t])<<6|63&e[t+1],r.push(n),t+=2):224==(240&n)?(n=(15&e[t])<<12|(63&e[t+1])<<6|63&e[t+2],r.push(n),t+=3):240==(248&n)?(n=(7&e[t])<<18|(63&e[t+1])<<12|(63&e[t+2])<<6|63&e[t+3],r.push(n),t+=4):t+=1}for(var a="";r.length>0;){var i=r.splice(0,this.UTF8_DECODE_CHUNK_SIZE);a+=String.fromCodePoint.apply(String,i)}return a},e.UTF8_DECODE_CHUNK_SIZE=100,e}();e=/^(0x)?([0-9a-fA-F]+)$/,r=/^(0b|0B)?([01]+)$/,t="0123456789abcdef",n={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15},Object.defineProperty(ArrayBuffer.prototype,"bytes",{configurable:s,enumerable:b,get:function(){return new Uint8Array(this)}}),Object.defineProperty(Uint8Array,"from",{configurable:s,writable:c,enumerable:b,value:function(t,a){if(Array.isArray(t))return new Uint8Array(t);if("string"==typeof t){if("hex"===a||16===a){if(!(f=t.match(e)))throw new RangeError("Input argument is not a valid hex string!");var i=f[2];i=i.length%2==0?i.toLowerCase():"0"+i.toLowerCase();for(var o=new Uint8Array(i.length/2|0),u=0;u<o.length;u++){var l=2*u;o[u]=n[i[l]]<<4|15&n[i[l+1]]}return o}if("bits"===a||2===a){var f;if(!(f=t.match(r)))throw new RangeError("Input argument is not a valid bit string!");var c=f[2];for(c.length%8!=0&&(c="0".repeat(c.length%8)+c),o=new Uint8Array(c.length/8|0),u=0;u<o.length;u++){for(var s="1"===c[l=8*u]?1:0,b=1;b<8;b++)s=s<<1|("1"===c[l+b]?1:0);o[u]=s}return o}return h.UTF8Encode(t)}var g=h.ExtractBytes(t);if(!g)throw new TypeError("Cannot convert given input data into array buffer!");return g}}),Object.defineProperty(Uint8Array,"compare",{configurable:s,writable:c,enumerable:b,value:function(e,r){var t=h.ExtractBytes(e),n=h.ExtractBytes(r);if(!t||!n)throw new TypeError("Given arguments must be instances of ArrayBuffer, TypedArray or DataView!");for(var a=Math.max(t.length,n.length),i=0;i<a;i++){var o=t[i]||0,u=n[i]||0;if(o>u)return 1;if(o<u)return-1}return 0}}),Object.defineProperty(Uint8Array,"dump",{configurable:s,writable:c,enumerable:b,value:function(e,r,n){void 0===r&&(r=16),void 0===n&&(n=!0);var a=h.ExtractBytes(e);if(null===a)throw new TypeError("Argument 1 expects an instance of ArrayBuffer, TypedArray or DataView!");var i="";switch(r){case 16:for(var o=0;o<a.length;o++){var u=a[o];i+=t[(240&u)>>>4]+t[15&u]}break;case 2:for(o=0;o<a.length;o++){u=a[o];for(var l=7;l>=0;l--)i+=u>>>l&1?"1":"0"}break;default:throw new RangeError("Unsupported numeric representation!")}return n?i:i.replace(/^0+/,"")}}),Object.defineProperty(Uint8Array,"concat",{configurable:s,writable:c,enumerable:b,value:function(e){if(!Array.isArray(e))throw new TypeError("Given argument must be an array of ArrayBuffer, TypedArray or DataView instances!");for(var r=0,t=[],n=0,a=e;n<a.length;n++){var i=a[n];if(null===(f=h.ExtractBytes(i)))throw new TypeError("Given argument must be an array of ArrayBuffer, TypedArray or DataView instances!");r+=f.length,t.push(f)}var o=new Uint8Array(r);r=0;for(var u=0,l=t;u<l.length;u++){var f=l[u];o.set(f,r),r+=f.length}return o}}),Object.defineProperty(Array.prototype,"unique",{writable:c,configurable:s,enumerable:b,value:function(){for(var e=new Set,r=0;r<this.length;r++){var t=this[r];e.add(t)}return Array.from(e)}}),Object.defineProperty(Array.prototype,"exclude",{writable:c,configurable:s,enumerable:b,value:function(e){Array.isArray(e)||(e=[e]);for(var r=[],t=0;t<this.length;t++){for(var n=this[t],a=!1,i=0,o=e;i<o.length;i++)if(n===o[i]){a=a||!0;break}a||r.push(n)}return r}}),Object.defineProperty(Date,"from",{writable:c,configurable:s,enumerable:b,value:function(e,r,t,n,a,i,o){if(0===arguments.length)throw new Error("Date.from expects at least one arguments!");try{return"string"==typeof e||1===arguments.length?new Date(e):2===arguments.length?new Date(e,r):3===arguments.length?new Date(e,r,t):4===arguments.length?new Date(e,r,t,n):5===arguments.length?new Date(e,r,t,n,a):6===arguments.length?new Date(e,r,t,n,a,i):new Date(e,r,t,n,a,i,o)}catch(e){return null}}}),Object.defineProperty(Date,"present",{configurable:s,enumerable:b,get:function(){return new Date}}),Object.defineProperty(Date,"unix",{writable:c,configurable:s,enumerable:b,value:function(){return Math.floor(Date.now()/1e3)}}),Object.defineProperty(Date,"zoneShift",{writable:c,configurable:s,enumerable:b,value:function(){return 6e4*(new Date).getTimezoneOffset()}}),Object.defineProperty(Date.prototype,"getUnixTime",{writable:c,configurable:s,enumerable:b,value:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"toLocaleISOString",{writable:c,configurable:s,enumerable:b,value:function(e){void 0===e&&(e=!1);var r,t=this.getTimezoneOffset();if(0===t)r="Z";else{var n=t>0?"-":"+";t=Math.abs(t);var a=Math.floor(t/60),i=t%60;r=n+h.Padding(a)+h.Padding(i)}var o=e?"."+h.Padding(this.getMilliseconds()%1e3,3):"";return this.getFullYear()+"-"+h.Padding(this.getMonth()+1)+"-"+h.Padding(this.getDate())+"T"+h.Padding(this.getHours())+":"+h.Padding(this.getMinutes())+":"+h.Padding(this.getSeconds())+o+r}}),Object.defineProperty(Date.prototype,"unix",{configurable:s,enumerable:b,get:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"time",{configurable:s,enumerable:b,get:function(){return this.getTime()}}),Object.defineProperty(Date.prototype,"zoneShift",{configurable:s,enumerable:b,get:function(){return 6e4*this.getTimezoneOffset()}}),"undefined"!=typeof Document&&Object.defineProperties(Document.prototype,{parseHTML:{configurable:s,writable:c,enumerable:b,value:function(e){var r=this.implementation.createHTMLDocument().body;r.innerHTML=e;var t=new DocumentFragment;if(0===r.children.length)return t;if(1===r.children.length){var n=r.children[0];return n.remove(),n}for(var a=0,i=Array.prototype.slice.call(r.children,0);a<i.length;a++){var o=i[a];t.appendChild(o)}return t}}}),"undefined"!=typeof Error&&Object.defineProperty(Error.prototype,"stack_trace",{get:function(){return this.stack?this.stack.split(/\r\n|\n/g).map((function(e){return e.trim()})):[]},enumerable:b,configurable:s}),"undefined"!=typeof EventTarget&&(Object.defineProperty(EventTarget.prototype,"on",{configurable:s,writable:c,enumerable:b,value:function(e,r){for(var t=[],n=0,a=e.split(",");n<a.length;n++){var i=a[n];i=i.trim(),t.indexOf(i)>=0||(t.push(i),this.addEventListener(i,r))}return this}}),Object.defineProperty(EventTarget.prototype,"off",{configurable:s,writable:c,enumerable:b,value:function(e,r){for(var t=0,n=e.split(",");t<n.length;t++){var a=n[t];a=a.trim(),this.removeEventListener(a,r)}return this}}),Object.defineProperty(EventTarget.prototype,"emit",{configurable:s,writable:c,enumerable:b,value:function(e,r){void 0===r&&(r={});var t=r.bubbles,n=r.cancelable,a=r.composed,i=l(r,["bubbles","cancelable","composed"]);if("string"==typeof e&&(e=new Event(e,{bubbles:!!t,cancelable:!!n,composed:!!a})),!(e instanceof Event))throw new TypeError("Argument 1 accepts only string or Event instance!");return Object.assign(e,i),this.dispatchEvent(e)}})),Object.defineProperty(Function,"sequential",{configurable:s,writable:c,enumerable:b,value:function(e,r,t){if(void 0===r&&(r=!1),void 0===t&&(t=!1),!Array.isArray(e))throw new TypeError("The first argument must be an array of functions!");return r=!!r,function(){for(var n=this,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var l=void 0,c={};if(r)return Promise.resolve().then((function(){return o(n,void 0,void 0,(function(){var r,n,i,o;return u(this,(function(u){switch(u.label){case 0:r=0,n=e,u.label=1;case 1:return r<n.length?"function"!=typeof(i=n[r])?(l=i,[3,3]):(o=t?f(f([],a),[l]):[l],[4,i.call.apply(i,f([c],o))]):[3,4];case 2:l=u.sent(),u.label=3;case 3:return r++,[3,1];case 4:return[2,l]}}))}))}));for(var s=0,b=e;s<b.length;s++){var h=b[s];if("function"==typeof h){var g=t?f(f([],a),[l]):[l];l=h.call.apply(h,f([c],g))}else l=h}return l}}}),function(){function e(t,n){for(var a in n)if(void 0!==n[a]){var i=t[a],o=n[a],u=r(i),l=r(o);"Object"===u&&"Object"===l?e(i,o):t[a]=o}}function r(e){var r=Object.prototype.toString.call(e);return r.substring(8,r.length-1)}Object.defineProperty(Object,"merge",{writable:c,configurable:s,enumerable:b,value:function(t){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var i=r(t);if("Object"!==i)throw new TypeError("This api expects argument 1 to be a simple object! But receved "+i+"!");for(var o=0,u=n;o<u.length;o++){var l=u[o];e(t,l)}return t}}),Object.defineProperty(Object,"typeOf",{writable:c,configurable:s,enumerable:b,value:r})}(),Object.defineProperties(Promise,{wait:{writable:c,configurable:s,enumerable:b,value:function(e){return void 0===e&&(e=[]),Array.isArray(e)||(e=[e]),0===e.length?Promise.resolve([]):new Promise((function(r,t){for(var n=[],a=0,i=!0,o=function(o){var u={resolved:!0,seq:o,result:null};n.push(u),Promise.resolve(e[o]).then((function(e){i=(u.resolved=!0)&&i,u.result=e}),(function(e){i=(u.resolved=!1)&&i,u.result=e})).then((function(){a++,e.length===a&&(i?r:t)(n)}))},u=0;u<e.length;u++)o(u)}))}},create:{writable:c,configurable:s,enumerable:b,value:function(){var e=null,r=null,t=new Promise((function(t,n){e=t,r=n}));return t.resolve=e,t.reject=r,t.promise=t,t}},chain:{writable:c,configurable:s,enumerable:b,value:function(e){var r=Promise.resolve();return"function"!=typeof e?r:r.then(e)}}}),a=/(\w)(\w*)(\W*)/g,i=function(e,r,t,n){return""+r.toUpperCase()+t.toLowerCase()+n},Object.defineProperties(String.prototype,{charCount:{configurable:s,enumerable:b,get:function(){for(var e=0,r=0;e<this.length;)r++,e+=this.codePointAt(e)>65535?2:1;return r}},upperCase:{configurable:s,enumerable:b,get:function(){return this.toUpperCase()}},localeUpperCase:{configurable:s,enumerable:b,get:function(){return this.toLocaleUpperCase()}},lowerCase:{configurable:s,enumerable:b,get:function(){return this.toLowerCase()}},localeLowerCase:{configurable:s,enumerable:b,get:function(){return this.toLocaleLowerCase()}},toCamelCase:{configurable:s,enumerable:b,value:function(){return this.replace(a,i)}},camelCase:{configurable:s,enumerable:b,get:function(){return this.replace(a,i)}},pull:{configurable:s,enumerable:b,writable:c,value:function(e,r){if(void 0===e&&(e=""),void 0===r&&(r=!0),"string"!=typeof e)throw new TypeError("Given token must be a string");var t,n=this.length;return 0===n?["",""]:""===e?r?[this[0],this.substring(1)]:[this.substring(0,n-1),this[n-1]]:r?(t=this.indexOf(e,e.length))<0?[this.substring(0),""]:[this.substring(0,t),this.substring(t)]:(t=this.lastIndexOf(e))<0?["",this.substring(0)]:[this.substring(0,t),this.substring(t)]}},cutin:{configurable:s,enumerable:b,writable:c,value:function(e,r){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];e<0&&(e+=this.length),r<=0&&(r=0);var a=this.substring(0,e),i=this.substring(e+r);return a+t.join("")+i}}}),Object.defineProperties(String,{encodeRegExpString:{writable:c,configurable:s,enumerable:b,value:function(e){return void 0===e&&(e=""),e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},from:{writable:c,configurable:s,enumerable:b,value:function(e){if("string"==typeof e)return e;var r=h.ExtractBytes(e);return null!==r?h.UTF8Decode(r):""+e}}}),function(){function e(){var e=null,r=!1,t=null,n=function(n,i){void 0===i&&(i=0);for(var o=[],u=2;u<arguments.length;u++)o[u-2]=arguments[u];e={cb:n,delay:i,args:o},r||(t&&(clearTimeout(t),t=null),a())};return n.clear=function(){e=null,t&&(clearTimeout(t),t=null)},n;function a(){if(e){var n=e.cb,i=e.delay,o=e.args;t=setTimeout((function(){r=!0,Promise.resolve(n.apply(void 0,o)).then((function(){r=!1,t=null,a()}),(function(n){throw r=!1,t=null,e=null,n}))}),i),e=null}}}Object.defineProperty(setTimeout,"create",{writable:c,configurable:s,enumerable:b,value:e}),Object.defineProperty(setTimeout,"idle",{writable:c,configurable:s,enumerable:b,value:function(e){void 0===e&&(e=0);return new Promise((function(r){setTimeout(r,e)}))}}),Object.defineProperty(setInterval,"create",{writable:c,configurable:s,enumerable:b,value:function(){var r=this,t=e(),n=function(e,n){void 0===n&&(n=0);for(var a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];var l=function(){return o(r,void 0,void 0,(function(){var r;return u(this,(function(i){switch(i.label){case 0:t(l,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.apply(void 0,a)];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),t.clear(),r;case 4:return[2]}}))}))};t.apply(void 0,f([l,n],a))};return n.clear=function(){t.clear()},n}})}()})();
{
"name": "extes",
"version": "4.1.2",
"version": "4.2.0",
"description": "A tiny library that extends native js with some handy tools",

@@ -5,0 +5,0 @@ "main": "./dist/extes.js",

@@ -703,10 +703,8 @@ const writable=true, configurable=true, enumerable=false;

value: function(target:{[key:string]:any}, ...sources:{[key:string]:any}[]):{[key:string]:any} {
if ( Object(target) !== target ) {
throw new TypeError("Argument 1 must be an object!");
const target_type = TypeOf(target);
if ( target_type !== "Object" ) {
throw new TypeError(`This api expects argument 1 to be a simple object! But receved ${target_type}!`);
}
for(const source of sources) {
if ( Object(source) !== source ) continue;
DeepMerge(target, source);
}
for(const source of sources) DeepMerge(target, source);

@@ -728,9 +726,4 @@ return target;

for (const key in source) {
let is_invalid = false;
is_invalid = (source.hasOwnProperty && !source.hasOwnProperty(key));
is_invalid = is_invalid || (source[key] === undefined);
if ( is_invalid ) continue;
if ( source[key] === undefined ) continue;
const tValue = target[key];

@@ -741,9 +734,4 @@ const sValue = source[key];

if ( tType !== "object" || sType !== "object" ) {
if ( target instanceof Map ) {
target.set(key, sValue);
}
else {
target[key] = sValue;
}
if ( tType !== "Object" || sType !== "Object" ) {
target[key] = sValue;
continue;

@@ -755,110 +743,5 @@ }

}
function TypeOf(input:any, resolveObj=false):string {
const type = typeof input;
switch(type) {
case "number":
case "string":
case "function":
case "boolean":
case "undefined":
case "symbol":
return type;
}
if ( input === null ) {
return "null";
}
if ( input instanceof String ) {
return "string";
}
if ( input instanceof Number ) {
return "number";
}
if ( input instanceof Boolean ) {
return "boolean";
}
if ( Array.isArray(input) ) {
return "array";
}
if ( !resolveObj ) {
return "object";
}
// None-primitive
if ( input instanceof ArrayBuffer ) {
return "array-buffer"
}
if ( input instanceof DataView ) {
return "data-view";
}
if ( input instanceof Uint8Array ) {
return "uint8-array";
}
if ( input instanceof Uint8ClampedArray ) {
return "uint8-clamped-array";
}
if ( input instanceof Int8Array ) {
return "int8-array";
}
if ( input instanceof Uint16Array ) {
return "uint16-array";
}
if ( input instanceof Int16Array ) {
return "int16-array";
}
if ( input instanceof Uint32Array ) {
return "uint32-array";
}
if ( input instanceof Int32Array ) {
return "int32-array";
}
if ( input instanceof Float32Array ) {
return "float32-array";
}
if ( input instanceof Float64Array ) {
return "float64-array";
}
if ( input instanceof Map ) {
return "map";
}
if ( input instanceof WeakMap ) {
return "weak-map";
}
if ( input instanceof Set ) {
return "set";
}
if ( input instanceof WeakSet ) {
return "weak-set";
}
if ( input instanceof RegExp ) {
return "regexp"
}
if ( input instanceof Promise ) {
return "promise";
}
return "object";
function TypeOf(input:any):string {
const result = Object.prototype.toString.call(input);
return result.substring(8, result.length-1);
}

@@ -865,0 +748,0 @@ })();

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc