Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "sugar-core", | ||
"description": "Core module for the Sugar Javascript utility library.", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"homepage": "https://sugarjs.com/", | ||
@@ -31,3 +31,6 @@ "icon": "https://sugarjs.com/icon.svg", | ||
"typings": "sugar.d.ts", | ||
"dependencies": { | ||
"sugar-core": "file:packages/sugar-core" | ||
}, | ||
"main": "sugar-core.js" | ||
} |
/* | ||
* Sugar v2.0.4 | ||
* Sugar v2.0.5 | ||
* | ||
@@ -9,22 +9,21 @@ * Freely distributable and licensed under the MIT-style license. | ||
* ---------------------------- */ | ||
(function(){'use strict';(function(){function l(a,b){for(var c in a)if(p(a,c)&&!1===b.call(a,a[c],c,a))break}function E(a){function b(a,c,b){k(d,a,function(a,e,f){a=y(a,e,f);U(d,a.methods,c,b,a.a);return d})}var c="Object"===a,d=F(a);b("defineStatic",1);b("defineInstance",2);b("defineInstanceAndStatic",3);b("defineStaticWithArguments",1,!0);b("defineInstanceWithArguments",2,!0);k(d,"defineStaticPolyfill",function(c,b,h){c=y(c,b,h);u(r[a],c.methods,!0,c.a);return d});k(d,"defineInstancePolyfill",function(c,b,h){c=y(c,b,h); | ||
u(r[a].prototype,c.methods,!0,c.a);l(c.methods,function(a,c){q(d,c,a)});return d});k(d,"alias",function(a,c){var b=d,e="string"===typeof c?d[c]:c;b[a]=e;e.instance&&q(b,a,e.instance);return d});k(d,"extend",function(b){function e(a,c){var d=b[a];if(d)for(var e=0,f;f=d[e];e++)if(f===c)return!0;return!1}function h(a,c,d){if(!c[a]||!d)return!1;for(a=0;a<d.length;a++)if(!1===b[d[a]])return!0}var g=r[a],t=g.prototype,m={},n={},q;b=b||{};q=b.methods;if(!e("except",g)&&(!b.namespaces||e("namespaces",g)))return c&& | ||
"boolean"===typeof b.objectPrototype&&(z=b.objectPrototype),l(q||d,function(a,b){q&&(b=a,a=d[b]);!p(a,"instance")||c&&t===t&&(!z||"get"===b||"set"===b)||h(b,t,a.flags)||e("except",b)||(n[b]=a.instance);!p(a,"static")||c&&g===t&&(!z||"get"===b||"set"===b)||h(b,g,a.flags)||e("except",b)||(m[b]=a)}),u(g,m),u(t,n),q||k(d,"active",!0),d});v[a]=d;G["[object "+a+"]"]=d;A(a);V(d);return g[a]=d}function W(){return"Sugar"}function U(a,b,c,d,e){l(b,function(b,h){var f,g=b;d&&(g=H(b));e&&(g.flags=e);c&2&&!b.instance&& | ||
(f=d?H(b,!0):X(b),k(g,"instance",f));c&1&&k(g,"static",!0);f=g;a[h]=f;f.instance&&q(a,h,f.instance);a.active&&a.extend(h)})}function y(a,b,c){var d;"string"===typeof a?(d={},d[a]=b,a=c):(d=a,a=b);return{a:a,methods:d}}function H(a,b){var c=a.length-1-(b?1:0);return function(){var d=[],e=[],f;b&&d.push(this);f=Math.max(arguments.length,c);for(var h=0;h<f;h++)h<c?d.push(arguments[h]):e.push(arguments[h]);d.push(e);return a.apply(this,d)}}function X(a){switch(a.length){case 0:case 1:return function(){return a(this)}; | ||
case 2:return function(b){return a(this,b)};case 3:return function(b,c){return a(this,b,c)};case 4:return function(b,c,d){return a(this,b,c,d)};case 5:return function(b,c,d,e){return a(this,b,c,d,e)}}}function u(a,b,c,d){l(b,function(b,f){c&&!d&&a[f]||k(a,f,b)})}function F(a){function b(a,d){if(!(this instanceof b))return new b(a,d);this.constructor!==b&&(a=this.constructor.apply(a,arguments));this.raw=a}k(b,"toString",function(){return"Sugar"+a});k(b.prototype,"valueOf",function(){return this.raw}); | ||
return b}function q(a,b,c){c=Y(c);var d,e,f;f=I.prototype;e=(d=f[b])&&d!==Object.prototype[b];d&&d.b||(f[b]=e?Z(b):c);a.prototype[b]=c;a===g.Object&&aa(b,c)}function V(a){l(g.Object&&g.Object.prototype,function(b,c){if("function"===typeof b){var d=a.prototype;p(d,c)||(d[c]=b)}})}function aa(a,b){l(v,function(c){c=c.prototype;p(c,a)||(c[a]=b)})}function Y(a){return function(){return new I(a.apply(this.raw,arguments))}}function Z(a){function b(){var b=this.raw,d;null!=b&&(d=G[B(b)]);d||(d=g.Object); | ||
d=(new d(b))[a];if(d.b)throw new TypeError("Cannot resolve namespace for "+b);return d.apply(this,arguments)}b.b=!0;return b}function A(a,b){var c=v[a],d=r[a].prototype;!b&&J&&(b=J(d));l(b,function(a){if("constructor"!==a&&"valueOf"!==a&&"__proto__"!==a){try{var b=d[a];if("function"!==typeof b)return}catch(h){return}q(c,a,b)}})}function ba(a,b,c){a[b]=c.value}function k(a,b,c,d){K(a,b,{value:c,enumerable:!!d,configurable:!0,writable:!0})}function B(a){return ca.call(a)}function p(a,b){return!!a&& | ||
da.call(a,b)}function ea(a,b){if(p(a,b))return a[b]}function C(a,b,c){c||(c=B(a));return c==="[object "+b+"]"}function L(a){return function(b,c,d){b[a](c,d)}}function m(a){if(!M(a))throw new TypeError("Function is not callable");}function fa(a){var b;b=typeof a;null!=a&&"string"!==b&&"number"!==b&&"boolean"!==b||(a=Object(a));if(ga&&w(a)){b=a;for(var c=0,d;d=b.charAt(c);)b[c++]=d}return a}function N(a,b,c,d){var e=[],f;for(f in a)f>>>0==f&&4294967295!=f&&(c||(d?f<=b:f>=b))&&e.push(+f);e.sort(function(a, | ||
c){var d=a>b;return d!==c>b?d?-1:1:a-c});return e}function ha(a){for(var b="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" "),c=0,d=b.length;c<d;c++){if(!(c in b)){for(var c=N(b,c,void 0),e=0,f=c.length;e<f;e++)d=c[e],a.call(b,b[d],d,b);break}a(b[c],c)}}function n(a,b){for(var c=ia(a).toString(10),d="0",e=b-c.replace(/\.\d+/,"").length,f="",d=d.toString();0<e;)if(e&1&&(f+=d),e>>=1)d+=d;c=f+c;0>a&&(c=(0>a?"-":"+")+c);return c}function ja(){function a(a,d){for(var c=0;c< | ||
b.length;c++)d.push(a+b[c])}var b="FullYear Month Date Hours Minutes Seconds Milliseconds".split(" ");l({Function:"apply,call",RegExp:"compile,exec,test",Number:"toExponential,toFixed,toLocaleString,toPrecision",Object:"hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString",Array:"concat,join,pop,push,reverse,shift,slice,sort,splice,toLocaleString,unshift",Date:"getTime,getTimezoneOffset,setTime,toDateString,toGMTString,toLocaleDateString,toLocaleString,toLocaleTimeString,toTimeString,toUTCString", | ||
String:"anchor,big,blink,bold,charAt,charCodeAt,concat,fixed,fontcolor,fontsize,indexOf,italics,lastIndexOf,link,localeCompare,match,replace,search,slice,small,split,strike,sub,substr,substring,sup,toLocaleLowerCase,toLocaleUpperCase,toLowerCase,toUpperCase"},function(b,d){var c=b.split(",");"Date"===d&&(a("get",c),a("set",c),a("getUTC",c),a("setUTC",c));c.push("toString");A(d,c)})}function O(a,b,c,d){var e=a.length,f,h;h=d?-1:1;f=d?e-1:0;(c=ka(c))||0===c||(c=f);0>c&&(c=e+c);if(!d&&0>c||d&&c>=e)c= | ||
f;for(f=c;d&&0<=f||!d&&f<e;){if(!(f in a))return la(a,b,c,d);if(f>>>0==f&&4294967295!=f&&a[f]===b)return f;f+=h}return-1}function la(a,b,c,d){c=N(a,c,!1,d);var e;for(c.sort(function(a,b){return d?b-a:a-b});void 0!==(e=c.shift());)if(a[e]===b)return+e;return-1}function P(a,b,c,d){var e=a.length,f=0,h=void 0!==c;m(b);if(0!=e||h)h||(c=a[d?e-1:f],f++);else throw new TypeError("Reduce called on empty array with no initial value");for(;f<e;)h=d?e-f-1:f,h in a&&(c=b(c,a[h],h,a)),f++;return c}var g,r="undefined"!== | ||
typeof global&&global.Object===Object?global:this,ma="undefined"!==typeof module&&module.c,z=!1,v={},G={},K=Object.defineProperty&&Object.defineProperties?Object.defineProperty:ba,I=F("Chainable"),J=Object.getOwnPropertyNames,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty;(function(){g=r.Sugar;if(!g){g=function(a){l(g,function(b,c){p(v,c)&&b.extend(a)});return g};if(ma)module.c=g;else try{r.Sugar=g}catch(a){}l("Object Number String Array Date RegExp Function".split(" "),function(a){E(a)}); | ||
k(g,"extend",g);k(g,"toString",W);k(g,"createNamespace",E);k(g,"util",{hasOwn:p,getOwn:ea,setProperty:k,classToString:B,defineProperty:K,forEachProperty:l,mapNativeToChainable:A})}})();var ga=!("0"in Object("a")),na=g.Object,Q=g.Array,R=g.Date,oa=g.String,pa=g.Function,w,M,S,D=L("defineStaticPolyfill"),x=L("defineInstancePolyfill"),ka=Math.trunc||function(a){return 0!==a&&isFinite(a)?0>a?qa(a):ra(a):a},ia=Math.abs,qa=Math.ceil,ra=Math.floor,T=String.fromCharCode;(function(){function a(a,d){return d&& | ||
C(new d,"Object")?b(d):c(a)}function b(a){var b=String(a);return function(a){return String(a.constructor)===b}}function c(a){return function(b,c){return C(b,a,c)}}function d(a){var b=a.toLowerCase();return function(c){var d=typeof c;return d===b||"object"===d&&C(c,a)}}(function(){var b="Boolean Number String Date RegExp Function Array Error Set Map".split(" ");w=d(b[2]);a(b[3]);a(b[4]);M=a(b[5]);S=Array.isArray||a(b[6]);a(b[7]);a(b[8],"undefined"!==typeof Set&&Set);a(b[9],"undefined"!==typeof Map&& | ||
Map)})();(function(){ha(function(){})})()})();(function(){for(var a=0;9>=a;a++)T(a+65296),T(a+48)})();var sa="valueOf toString constructor isPrototypeOf hasOwnProperty toLocaleString propertyIsEnumerable".split(" ");(function(){if(!{toString:1}.propertyIsEnumerable("toString")){var a=l;l=function(b,c){a(b,c);for(var d=0,e;(e=sa[d])&&(!p(b,e)||!1!==c.call(b,b[e],e,b));d++);}}})();Object.getOwnPropertyNames||ja();D(na,{keys:function(a){var b=[];if(null==a)throw new TypeError("Object required");l(fa(a), | ||
function(a,d){b.push(d)});return b}});D(Q,{isArray:function(a){return S(a)}});x(Q,{every:function(a){var b=arguments[1],c=this.length,d=0;for(m(a);d<c;){if(d in this&&!a.call(b,this[d],d,this))return!1;d++}return!0},some:function(a){var b=arguments[1],c=this.length,d=0;for(m(a);d<c;){if(d in this&&a.call(b,this[d],d,this))return!0;d++}return!1},map:function(a){var b=arguments[1],c=this.length,d=0,e=Array(c);for(m(a);d<c;)d in this&&(e[d]=a.call(b,this[d],d,this)),d++;return e},filter:function(a){var b= | ||
arguments[1],c=this.length,d=0,e=[];for(m(a);d<c;)d in this&&a.call(b,this[d],d,this)&&e.push(this[d]),d++;return e},indexOf:function(a){var b=arguments[1];return w(this)?this.indexOf(a,b):O(this,a,b)},lastIndexOf:function(a){var b=arguments[1];return w(this)?this.lastIndexOf(a,b):O(this,a,b,!0)},forEach:function(a){var b=arguments[1],c=this.length,d=0;for(m(a);d<c;)d in this&&a.call(b,this[d],d,this),d++},reduce:function(a){return P(this,a,arguments[1])},reduceRight:function(a){return P(this,a,arguments[1], | ||
!0)}});var ta=RegExp("^[\t\n\x0B\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff]+|[\t\n\x0B\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff]+$","g");x(oa,{trim:function(){return this.toString().replace(ta,"")}});x(pa,{bind:function(a){for(var b=[],c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);var e=this;m(this);c=function(){for(var c=[],d= | ||
0,g=arguments.length;d<g;d++)c.push(arguments[d]);return e.apply(e.prototype&&this instanceof e?this:a,b.concat(c))};c.prototype=this.prototype;return c}});D(R,{now:function(){return(new Date).getTime()}});x(R,{toISOString:function(){return n(this.getUTCFullYear(),4)+"-"+n(this.getUTCMonth()+1,2)+"-"+n(this.getUTCDate(),2)+"T"+n(this.getUTCHours(),2)+":"+n(this.getUTCMinutes(),2)+":"+n(this.getUTCSeconds(),2)+"."+n(this.getUTCMilliseconds(),3)+"Z"},toJSON:function(a){return this.toISOString(a)}}, | ||
!function(){var a=new Date(Date.UTC(2E3,0));return!!a.toISOString&&"2000-01-01T00:00:00.000Z"===a.toISOString()}())}).call(this);}).call(this); | ||
(function(){'use strict';(function(){function l(a,b){for(var d in a)if(p(a,d)&&!1===b.call(a,a[d],d,a))break}function E(a){return a&&a.Object===Object?a:null}function F(a){function b(a,d,b){k(c,a,function(a,e,f){a=y(a,e,f);V(c,a.methods,d,b,a.a);return c})}var d="Object"===a,c=G(a,!0);b("defineStatic",1);b("defineInstance",2);b("defineInstanceAndStatic",3);b("defineStaticWithArguments",1,!0);b("defineInstanceWithArguments",2,!0);k(c,"defineStaticPolyfill",function(d,b,g){d=y(d,b,g);v(u[a],d.methods,!0,d.a);return c});k(c, | ||
"defineInstancePolyfill",function(d,b,g){d=y(d,b,g);v(u[a].prototype,d.methods,!0,d.a);l(d.methods,function(a,d){r(c,d,a)});return c});k(c,"alias",function(a,d){var b=c;d="string"===typeof d?c[d]:d;b[a]=d;d.instance&&r(b,a,d.instance,!0);return c});k(c,"extend",function(b){function e(a,d){if(a=b[a])for(var c=0,e;e=a[c];c++)if(e===d)return!0;return!1}function g(a,d){return b[a]&&!e(a,d)}function h(a,d,c){if(!d[a]||!c)return!1;for(a=0;a<c.length;a++)if(!1===b[c[a]])return!0}var t=u[a],m=t.prototype, | ||
n={},r={};b=b||{};var q=b.methods;if(!e("except",t)&&!g("namespaces",t))return d&&"boolean"===typeof b.objectPrototype&&(z=b.objectPrototype),l(q||c,function(a,b){q&&(b=a,a=c[b]);!p(a,"instance")||d&&m===m&&(!z||"get"===b||"set"===b)||h(b,m,a.flags)||e("except",b)||(r[b]=a.instance);!p(a,"static")||d&&t===m&&(!z||"get"===b||"set"===b)||h(b,t,a.flags)||e("except",b)||(n[b]=a)}),v(t,n),v(m,r),q||k(c,"active",!0),c});q[a]=c;H["[object "+a+"]"]=c;A(a);W(c);return h[a]=c}function X(){return"Sugar"}function V(a, | ||
b,d,c,e){l(b,function(b,g){var f=b;c&&(f=I(b));e&&(f.flags=e);d&2&&!b.instance&&(b=c?I(b,!0):Y(b),k(f,"instance",b));d&1&&k(f,"static",!0);a[g]=f;f.instance&&r(a,g,f.instance,!0);a.active&&a.extend(g)})}function y(a,b,d){if("string"===typeof a){var c={};c[a]=b;a=d}else c=a,a=b;return{a:a,methods:c}}function I(a,b){var d=a.length-1-(b?1:0);return function(){var c=[],e=[];b&&c.push(this);var f=Math.max(arguments.length,d);for(var g=0;g<f;g++)g<d?c.push(arguments[g]):e.push(arguments[g]);c.push(e);return a.apply(this, | ||
c)}}function Y(a){switch(a.length){case 0:case 1:return function(){return a(this)};case 2:return function(b){return a(this,b)};case 3:return function(b,d){return a(this,b,d)};case 4:return function(b,d,c){return a(this,b,d,c)};case 5:return function(b,d,c,e){return a(this,b,d,c,e)}}}function v(a,b,d,c){l(b,function(b,f){d&&!c&&a[f]||k(a,f,b)})}function G(a){function b(a,c){if(!(this instanceof b))return new b(a,c);this.constructor!==b&&(a=this.constructor.apply(a,arguments));this.raw=a}k(b,"toString", | ||
function(){return"Sugar"+a});k(b.prototype,"valueOf",function(){return this.raw});return b}function r(a,b,d){d=Z(d);var c;var e=J.prototype;var f=(c=e[b])&&c!==Object.prototype[b];c&&c.b||(e[b]=f?aa(b):d);a.prototype[b]=d;a===h.Object&&ba(b,d)}function W(a){l(h.Object&&h.Object.prototype,function(b,d){if("function"===typeof b){var c=a.prototype;p(c,d)||(c[d]=b)}})}function ba(a,b){l(q,function(d){d=d.prototype;p(d,a)||(d[a]=b)})}function Z(a){return function(){return new J(a.apply(this.raw,arguments))}} | ||
function aa(a){function b(){var b=this.raw,c;null!=b&&(c=H[B(b)]);c||(c=h.Object);return(new c(b))[a].apply(this,arguments)}b.b=!0;return b}function A(a,b){var d=q[a],c=u[a].prototype;!b&&K&&(b=K(c));l(b,function(a){if("constructor"!==a&&"valueOf"!==a&&"__proto__"!==a){try{var b=c[a];if("function"!==typeof b)return}catch(g){return}r(d,a,b)}})}function ca(a,b,d){a[b]=d.value}function k(a,b,d,c){L(a,b,{value:d,enumerable:!!c,configurable:!0,writable:!0})}function B(a){return da.call(a)}function p(a, | ||
b){return!!a&&ea.call(a,b)}function fa(a,b){if(p(a,b))return a[b]}function C(a,b,d){d||(d=B(a));return d==="[object "+b+"]"}function M(a){return function(b,d,c){b[a](d,c)}}function m(a){if(!N(a))throw new TypeError("Function is not callable");}function ha(a){var b=typeof a;null!=a&&"string"!==b&&"number"!==b&&"boolean"!==b||(a=Object(a));if(ia&&w(a)){b=a;for(var d=0,c;c=b.charAt(d);)b[d++]=c}return a}function O(a,b,d,c){var e=[],f;for(f in a)f>>>0==f&&4294967295!=f&&(d||(c?f<=b:f>=b))&&e.push(+f); | ||
e.sort(function(a,d){var c=a>b;return c!==d>b?c?-1:1:a-d});return e}function ja(a,b){for(var d=0,c=a.length;d<c;d++){if(!(d in a)){c=O(a,d,void 0);for(var e=0,f=c.length;e<f;e++)d=c[e],b.call(a,a[d],d,a);return a}b(a[d],d)}}function n(a,b,d,c,e){c=ka(a).toString(c||10);e=e||"0";b-=c.replace(/\.\d+/,"").length;var f="";for(e=e.toString();0<b;)if(b&1&&(f+=e),b>>=1)e+=e;c=f+c;if(d||0>a)c=(0>a?"-":"+")+c;return c}function la(){function a(a,c){for(var d=0;d<b.length;d++)c.push(a+b[d])}var b="FullYear Month Date Hours Minutes Seconds Milliseconds".split(" "); | ||
l({Function:"apply,call",RegExp:"compile,exec,test",Number:"toExponential,toFixed,toLocaleString,toPrecision",Object:"hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString",Array:"concat,join,pop,push,reverse,shift,slice,sort,splice,toLocaleString,unshift",Date:"getTime,getTimezoneOffset,setTime,toDateString,toGMTString,toLocaleDateString,toLocaleString,toLocaleTimeString,toTimeString,toUTCString",String:"anchor,big,blink,bold,charAt,charCodeAt,concat,fixed,fontcolor,fontsize,indexOf,italics,lastIndexOf,link,localeCompare,match,replace,search,slice,small,split,strike,sub,substr,substring,sup,toLocaleLowerCase,toLocaleUpperCase,toLowerCase,toUpperCase"}, | ||
function(b,c){b=b.split(",");"Date"===c&&(a("get",b),a("set",b),a("getUTC",b),a("setUTC",b));b.push("toString");A(c,b)})}function P(a,b,d,c){var e=a.length;var f=c?-1:1;var g=c?e-1:0;(d=ma(d))||0===d||(d=g);0>d&&(d=e+d);if(!c&&0>d||c&&d>=e)d=g;for(g=d;c&&0<=g||!c&&g<e;){if(!(g in a))return na(a,b,d,c);if(g>>>0==g&&4294967295!=g&&a[g]===b)return g;g+=f}return-1}function na(a,b,d,c){d=O(a,d,!1,c);var e;for(d.sort(function(a,b){return c?b-a:a-b});void 0!==(e=d.shift());)if(a[e]===b)return+e;return-1} | ||
function Q(a,b,d,c){var e=a.length,f=0,g=void 0!==d;m(b);if(0!=e||g)g||(d=a[c?e-1:f],f++);else throw new TypeError("Reduce called on empty array with no initial value");for(;f<e;)g=c?e-f-1:f,g in a&&(d=b(d,a[g],g,a)),f++;return d}var h,u=E("undefined"!==typeof global&&global)||E("undefined"!==typeof window&&window),z=!1,q={},H={},L=Object.defineProperty&&Object.defineProperties?Object.defineProperty:ca,J=G("Chainable"),K=Object.getOwnPropertyNames,da=Object.prototype.toString,ea=Object.prototype.hasOwnProperty; | ||
(function(){h=u.Sugar;if(!h){h=function(a){l(h,function(b,d){p(q,d)&&b.extend(a)});return h};if("undefined"!==typeof module&&module.c)module.c=h;else try{u.Sugar=h}catch(a){}l("Object Number String Array Date RegExp Function".split(" "),function(a){F(a)});k(h,"VERSION","2.0.5");k(h,"extend",h);k(h,"toString",X);k(h,"createNamespace",F);k(h,"util",{hasOwn:p,getOwn:fa,setProperty:k,classToString:B,defineProperty:L,forEachProperty:l,mapNativeToChainable:A})}})();var ia=!("0"in Object("a")),oa=h.Object, | ||
R=h.Array,S=h.Date,pa=h.String,qa=h.Function,w,N,T,D=M("defineStaticPolyfill"),x=M("defineInstancePolyfill"),ma=Math.trunc||function(a){return 0!==a&&isFinite(a)?0>a?ra(a):sa(a):a},ka=Math.abs,ra=Math.ceil,sa=Math.floor,U=String.fromCharCode;(function(){function a(a,c){return c&&C(new c,"Object")?b(c):d(a)}function b(a){var b=String(a);return function(a){return String(a.constructor)===b}}function d(a){return function(b,c){return C(b,a,c)}}function c(a){var b=a.toLowerCase();return function(c){var d= | ||
typeof c;return d===b||"object"===d&&C(c,a)}}(function(){var b="Boolean Number String Date RegExp Function Array Error Set Map".split(" ");w=c(b[2]);a(b[3]);a(b[4]);N=a(b[5]);T=Array.isArray||a(b[6]);a(b[7]);a(b[8],"undefined"!==typeof Set&&Set);a(b[9],"undefined"!==typeof Map&&Map)})();(function(){ja("Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" "),function(){})})()})();(function(){for(var a=0;9>=a;a++)U(a+65296),U(a+48)})();var ta="valueOf toString constructor isPrototypeOf hasOwnProperty toLocaleString propertyIsEnumerable".split(" "); | ||
(function(){if(!{toString:1}.propertyIsEnumerable("toString")){var a=l;l=function(b,d){a(b,d);for(var c=0,e;(e=ta[c])&&(!p(b,e)||!1!==d.call(b,b[e],e,b));c++);}}})();Object.getOwnPropertyNames||la();D(oa,{keys:function(a){var b=[];if(null==a)throw new TypeError("Object required");l(ha(a),function(a,c){b.push(c)});return b}});D(R,{isArray:function(a){return T(a)}});x(R,{every:function(a){var b=arguments[1],d=this.length,c=0;for(m(a);c<d;){if(c in this&&!a.call(b,this[c],c,this))return!1;c++}return!0}, | ||
some:function(a){var b=arguments[1],d=this.length,c=0;for(m(a);c<d;){if(c in this&&a.call(b,this[c],c,this))return!0;c++}return!1},map:function(a){var b=arguments[1],d=this.length,c=0,e=Array(d);for(m(a);c<d;)c in this&&(e[c]=a.call(b,this[c],c,this)),c++;return e},filter:function(a){var b=arguments[1],d=this.length,c=0,e=[];for(m(a);c<d;)c in this&&a.call(b,this[c],c,this)&&e.push(this[c]),c++;return e},indexOf:function(a){var b=arguments[1];return w(this)?this.indexOf(a,b):P(this,a,b)},lastIndexOf:function(a){var b= | ||
arguments[1];return w(this)?this.lastIndexOf(a,b):P(this,a,b,!0)},forEach:function(a){var b=arguments[1],d=this.length,c=0;for(m(a);c<d;)c in this&&a.call(b,this[c],c,this),c++},reduce:function(a){return Q(this,a,arguments[1])},reduceRight:function(a){return Q(this,a,arguments[1],!0)}});var ua=/^[\t\n\x0B\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff]+|[\t\n\x0B\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff]+$/g; | ||
x(pa,{trim:function(){return this.toString().replace(ua,"")}});x(qa,{bind:function(a){for(var b=[],d=1,c=arguments.length;d<c;d++)b.push(arguments[d]);var e=this;m(this);d=function(){for(var c=[],d=0,h=arguments.length;d<h;d++)c.push(arguments[d]);return e.apply(e.prototype&&this instanceof e?this:a,b.concat(c))};d.prototype=this.prototype;return d}});D(S,{now:function(){return(new Date).getTime()}});x(S,{toISOString:function(){return n(this.getUTCFullYear(),4)+"-"+n(this.getUTCMonth()+1,2)+"-"+n(this.getUTCDate(), | ||
2)+"T"+n(this.getUTCHours(),2)+":"+n(this.getUTCMinutes(),2)+":"+n(this.getUTCSeconds(),2)+"."+n(this.getUTCMilliseconds(),3)+"Z"},toJSON:function(a){return this.toISOString(a)}},!function(){var a=new Date(Date.UTC(2E3,0));return!!a.toISOString&&"2000-01-01T00:00:00.000Z"===a.toISOString()}())}).call(this);}).call(this); |
/* | ||
* Sugar v2.0.4 | ||
* Sugar v2.0.5 | ||
* | ||
@@ -38,9 +38,4 @@ * Freely distributable and licensed under the MIT-style license. | ||
// The global context. Rhino uses a different "global" keyword so | ||
// do an extra check to be sure that it's actually the global context. | ||
var globalContext = typeof global !== 'undefined' && global.Object === Object ? global : this; | ||
var globalContext = getGlobal(); | ||
// Is the environment node? | ||
var hasExports = typeof module !== 'undefined' && module.exports; | ||
// Whether object instance methods can be mapped to the prototype. | ||
@@ -56,2 +51,3 @@ var allowObjectPrototype = false; | ||
// Defining properties. | ||
// istanbul ignore next | ||
var defineProperty = PROPERTY_DESCRIPTOR_SUPPORT ? Object.defineProperty : definePropertyShim; | ||
@@ -65,4 +61,18 @@ | ||
function getGlobal() { | ||
// Get global context by keyword here to avoid issues with libraries | ||
// that can potentially alter this script's context object. | ||
return testGlobal(typeof global !== 'undefined' && global) || | ||
testGlobal(typeof window !== 'undefined' && window); | ||
} | ||
function testGlobal(obj) { | ||
// Note that Rhino uses a different "global" keyword so perform an | ||
// extra check here to ensure that it's actually the global object. | ||
return obj && obj.Object === Object ? obj : null; | ||
} | ||
function setupGlobal() { | ||
Sugar = globalContext[SUGAR_GLOBAL]; | ||
// istanbul ignore if | ||
if (Sugar) { | ||
@@ -84,5 +94,8 @@ // Reuse already defined Sugar global object. | ||
}; | ||
if (hasExports) { | ||
// istanbul ignore else | ||
if (typeof module !== 'undefined' && module.exports) { | ||
// Node or webpack environment | ||
module.exports = Sugar; | ||
} else { | ||
// Unwrapped browser environment | ||
try { | ||
@@ -441,3 +454,5 @@ globalContext[SUGAR_GLOBAL] = Sugar; | ||
* spec. Accepts either a single object mapping names to functions, or | ||
* name and function as two arguments. | ||
* name and function as two arguments. Note that polyfill methods will | ||
* be immediately mapped onto their native prototype regardless of the | ||
* use of `extend`. | ||
* | ||
@@ -474,3 +489,4 @@ * @example | ||
* is mapped as-is to the native), so it should refer to its `this` | ||
* object. | ||
* object. Note that polyfill methods will be immediately mapped onto | ||
* their native prototype regardless of the use of `extend`. | ||
* | ||
@@ -536,2 +552,3 @@ * @example | ||
function setGlobalProperties() { | ||
setProperty(Sugar, 'VERSION', '2.0.5'); | ||
setProperty(Sugar, 'extend', Sugar); | ||
@@ -768,3 +785,3 @@ setProperty(Sugar, 'toString', toString); | ||
var fn = function() { | ||
var raw = this.raw, sugarNamespace, fn; | ||
var raw = this.raw, sugarNamespace; | ||
if (raw != null) { | ||
@@ -782,12 +799,3 @@ // Find the Sugar namespace for this unknown. | ||
fn = new sugarNamespace(raw)[methodName]; | ||
if (fn.disambiguate) { | ||
// If the method about to be called on this chainable is | ||
// itself a disambiguation method, then throw an error to | ||
// prevent infinite recursion. | ||
throw new TypeError('Cannot resolve namespace for ' + raw); | ||
} | ||
return fn.apply(this, arguments); | ||
return new sugarNamespace(raw)[methodName].apply(this, arguments); | ||
}; | ||
@@ -852,2 +860,3 @@ fn.disambiguate = true; | ||
// istanbul ignore next | ||
function definePropertyShim(obj, prop, descriptor) { | ||
@@ -854,0 +863,0 @@ obj[prop] = descriptor.value; |
/* | ||
* Sugar v2.0.4 | ||
* Sugar v2.0.5 | ||
* | ||
@@ -9,10 +9,10 @@ * Freely distributable and licensed under the MIT-style license. | ||
* ---------------------------- */ | ||
(function(){'use strict';(function(){function l(b,a){for(var d in b)if(m(b,d)&&!1===a.call(b,b[d],d,b))break}function x(b){function a(b,a,d){h(c,b,function(b,g,f){b=v(b,g,f);G(c,b.methods,a,d,b.a);return c})}var d="Object"===b,c=y(b);a("defineStatic",1);a("defineInstance",2);a("defineInstanceAndStatic",3);a("defineStaticWithArguments",1,!0);a("defineInstanceWithArguments",2,!0);h(c,"defineStaticPolyfill",function(a,d,r){a=v(a,d,r);t(q[b],a.methods,!0,a.a);return c});h(c,"defineInstancePolyfill",function(a,d,r){a=v(a,d,r); | ||
t(q[b].prototype,a.methods,!0,a.a);l(a.methods,function(b,a){n(c,a,b)});return c});h(c,"alias",function(b,a){var d=c,g="string"===typeof a?c[a]:a;d[b]=g;g.instance&&n(d,b,g.instance);return c});h(c,"extend",function(a){function f(b,d){var c=a[b];if(c)for(var g=0,f;f=c[g];g++)if(f===d)return!0;return!1}function g(b,d,c){if(!d[b]||!c)return!1;for(b=0;b<c.length;b++)if(!1===a[c[b]])return!0}var e=q[b],k=e.prototype,n={},p={},u;a=a||{};u=a.methods;if(!f("except",e)&&(!a.namespaces||f("namespaces",e)))return d&& | ||
"boolean"===typeof a.objectPrototype&&(w=a.objectPrototype),l(u||c,function(b,a){u&&(a=b,b=c[a]);!m(b,"instance")||d&&k===k&&(!w||"get"===a||"set"===a)||g(a,k,b.flags)||f("except",a)||(p[a]=b.instance);!m(b,"static")||d&&e===k&&(!w||"get"===a||"set"===a)||g(a,e,b.flags)||f("except",a)||(n[a]=b)}),t(e,n),t(k,p),u||h(c,"active",!0),c});p[b]=c;z["[object "+b+"]"]=c;A(b);H(c);return e[b]=c}function I(){return"Sugar"}function G(b,a,d,c,g){l(a,function(a,e){var f,k=a;c&&(k=B(a));g&&(k.flags=g);d&2&&!a.instance&& | ||
(f=c?B(a,!0):J(a),h(k,"instance",f));d&1&&h(k,"static",!0);f=k;b[e]=f;f.instance&&n(b,e,f.instance);b.active&&b.extend(e)})}function v(b,a,d){var c;"string"===typeof b?(c={},c[b]=a,b=d):(c=b,b=a);return{a:b,methods:c}}function B(b,a){var d=b.length-1-(a?1:0);return function(){var c=[],g=[],f;a&&c.push(this);f=Math.max(arguments.length,d);for(var e=0;e<f;e++)e<d?c.push(arguments[e]):g.push(arguments[e]);c.push(g);return b.apply(this,c)}}function J(b){switch(b.length){case 0:case 1:return function(){return b(this)}; | ||
case 2:return function(a){return b(this,a)};case 3:return function(a,d){return b(this,a,d)};case 4:return function(a,d,c){return b(this,a,d,c)};case 5:return function(a,d,c,e){return b(this,a,d,c,e)}}}function t(b,a,d,c){l(a,function(a,e){d&&!c&&b[e]||h(b,e,a)})}function y(b){function a(b,c){if(!(this instanceof a))return new a(b,c);this.constructor!==a&&(b=this.constructor.apply(b,arguments));this.raw=b}h(a,"toString",function(){return"Sugar"+b});h(a.prototype,"valueOf",function(){return this.raw}); | ||
return a}function n(b,a,d){d=K(d);var c,g,f;f=C.prototype;g=(c=f[a])&&c!==Object.prototype[a];c&&c.b||(f[a]=g?L(a):d);b.prototype[a]=d;b===e.Object&&M(a,d)}function H(b){l(e.Object&&e.Object.prototype,function(a,d){if("function"===typeof a){var c=b.prototype;m(c,d)||(c[d]=a)}})}function M(b,a){l(p,function(d){d=d.prototype;m(d,b)||(d[b]=a)})}function K(b){return function(){return new C(b.apply(this.raw,arguments))}}function L(b){function a(){var a=this.raw,c;null!=a&&(c=z[D(a)]);c||(c=e.Object);c= | ||
(new c(a))[b];if(c.b)throw new TypeError("Cannot resolve namespace for "+a);return c.apply(this,arguments)}a.b=!0;return a}function A(b,a){var d=p[b],c=q[b].prototype;!a&&E&&(a=E(c));l(a,function(a){if("constructor"!==a&&"valueOf"!==a&&"__proto__"!==a){try{var b=c[a];if("function"!==typeof b)return}catch(r){return}n(d,a,b)}})}function N(b,a,d){b[a]=d.value}function h(b,a,d,c){F(b,a,{value:d,enumerable:!!c,configurable:!0,writable:!0})}function D(b){return O.call(b)}function m(b,a){return!!b&&P.call(b, | ||
a)}function Q(b,a){if(m(b,a))return b[a]}var e,q="undefined"!==typeof global&&global.Object===Object?global:this,R="undefined"!==typeof module&&module.c,w=!1,p={},z={},F=Object.defineProperty&&Object.defineProperties?Object.defineProperty:N,C=y("Chainable"),E=Object.getOwnPropertyNames,O=Object.prototype.toString,P=Object.prototype.hasOwnProperty;(function(){e=q.Sugar;if(!e){e=function(b){l(e,function(a,d){m(p,d)&&a.extend(b)});return e};if(R)module.c=e;else try{q.Sugar=e}catch(b){}l("Object Number String Array Date RegExp Function".split(" "), | ||
function(b){x(b)});h(e,"extend",e);h(e,"toString",I);h(e,"createNamespace",x);h(e,"util",{hasOwn:m,getOwn:Q,setProperty:h,classToString:D,defineProperty:F,forEachProperty:l,mapNativeToChainable:A})}})()}).call(this);}).call(this); | ||
(function(){'use strict';(function(){function h(b,a){for(var d in b)if(k(b,d)&&!1===a.call(b,b[d],d,b))break}function x(b){return b&&b.Object===Object?b:null}function y(b){function a(b,a,d){f(c,b,function(b,p,g){b=l(b,p,g);H(c,b.methods,a,d,b.a);return c})}var d="Object"===b,c=z(b,!0);a("defineStatic",1);a("defineInstance",2);a("defineInstanceAndStatic",3);a("defineStaticWithArguments",1,!0);a("defineInstanceWithArguments",2,!0);f(c,"defineStaticPolyfill",function(a,d,u){a=l(a,d,u);v(r[b],a.methods,!0,a.a);return c});f(c, | ||
"defineInstancePolyfill",function(a,d,u){a=l(a,d,u);v(r[b].prototype,a.methods,!0,a.a);h(a.methods,function(b,a){m(c,a,b)});return c});f(c,"alias",function(b,a){var d=c;a="string"===typeof a?c[a]:a;d[b]=a;a.instance&&m(d,b,a.instance,!0);return c});f(c,"extend",function(a){function g(b,d){if(b=a[b])for(var c=0,g;g=b[c];c++)if(g===d)return!0;return!1}function p(b,d){return a[b]&&!g(b,d)}function e(b,d,c){if(!d[b]||!c)return!1;for(b=0;b<c.length;b++)if(!1===a[c[b]])return!0}var q=r[b],t=q.prototype, | ||
m={},n={};a=a||{};var l=a.methods;if(!g("except",q)&&!p("namespaces",q))return d&&"boolean"===typeof a.objectPrototype&&(w=a.objectPrototype),h(l||c,function(b,a){l&&(a=b,b=c[a]);!k(b,"instance")||d&&t===t&&(!w||"get"===a||"set"===a)||e(a,t,b.flags)||g("except",a)||(n[a]=b.instance);!k(b,"static")||d&&q===t&&(!w||"get"===a||"set"===a)||e(a,q,b.flags)||g("except",a)||(m[a]=b)}),v(q,m),v(t,n),l||f(c,"active",!0),c});n[b]=c;A["[object "+b+"]"]=c;B(b);I(c);return e[b]=c}function J(){return"Sugar"}function H(b, | ||
a,d,c,p){h(a,function(a,e){var g=a;c&&(g=C(a));p&&(g.flags=p);d&2&&!a.instance&&(a=c?C(a,!0):K(a),f(g,"instance",a));d&1&&f(g,"static",!0);b[e]=g;g.instance&&m(b,e,g.instance,!0);b.active&&b.extend(e)})}function l(b,a,d){if("string"===typeof b){var c={};c[b]=a;b=d}else c=b,b=a;return{a:b,methods:c}}function C(b,a){var d=b.length-1-(a?1:0);return function(){var c=[],e=[];a&&c.push(this);var g=Math.max(arguments.length,d);for(var f=0;f<g;f++)f<d?c.push(arguments[f]):e.push(arguments[f]);c.push(e);return b.apply(this, | ||
c)}}function K(b){switch(b.length){case 0:case 1:return function(){return b(this)};case 2:return function(a){return b(this,a)};case 3:return function(a,d){return b(this,a,d)};case 4:return function(a,d,c){return b(this,a,d,c)};case 5:return function(a,d,c,e){return b(this,a,d,c,e)}}}function v(b,a,d,c){h(a,function(a,e){d&&!c&&b[e]||f(b,e,a)})}function z(b){function a(b,c){if(!(this instanceof a))return new a(b,c);this.constructor!==a&&(b=this.constructor.apply(b,arguments));this.raw=b}f(a,"toString", | ||
function(){return"Sugar"+b});f(a.prototype,"valueOf",function(){return this.raw});return a}function m(b,a,d){d=L(d);var c;var f=D.prototype;var g=(c=f[a])&&c!==Object.prototype[a];c&&c.b||(f[a]=g?M(a):d);b.prototype[a]=d;b===e.Object&&N(a,d)}function I(b){h(e.Object&&e.Object.prototype,function(a,d){if("function"===typeof a){var c=b.prototype;k(c,d)||(c[d]=a)}})}function N(b,a){h(n,function(d){d=d.prototype;k(d,b)||(d[b]=a)})}function L(b){return function(){return new D(b.apply(this.raw,arguments))}} | ||
function M(b){function a(){var a=this.raw,c;null!=a&&(c=A[E(a)]);c||(c=e.Object);return(new c(a))[b].apply(this,arguments)}a.b=!0;return a}function B(b,a){var d=n[b],c=r[b].prototype;!a&&F&&(a=F(c));h(a,function(a){if("constructor"!==a&&"valueOf"!==a&&"__proto__"!==a){try{var b=c[a];if("function"!==typeof b)return}catch(u){return}m(d,a,b)}})}function O(b,a,d){b[a]=d.value}function f(b,a,d,c){G(b,a,{value:d,enumerable:!!c,configurable:!0,writable:!0})}function E(b){return P.call(b)}function k(b,a){return!!b&& | ||
Q.call(b,a)}function R(b,a){if(k(b,a))return b[a]}var e,r=x("undefined"!==typeof global&&global)||x("undefined"!==typeof window&&window),w=!1,n={},A={},G=Object.defineProperty&&Object.defineProperties?Object.defineProperty:O,D=z("Chainable"),F=Object.getOwnPropertyNames,P=Object.prototype.toString,Q=Object.prototype.hasOwnProperty;(function(){e=r.Sugar;if(!e){e=function(b){h(e,function(a,d){k(n,d)&&a.extend(b)});return e};if("undefined"!==typeof module&&module.c)module.c=e;else try{r.Sugar=e}catch(b){}h("Object Number String Array Date RegExp Function".split(" "), | ||
function(b){y(b)});f(e,"VERSION","2.0.5");f(e,"extend",e);f(e,"toString",J);f(e,"createNamespace",y);f(e,"util",{hasOwn:k,getOwn:R,setProperty:f,classToString:E,defineProperty:G,forEachProperty:h,mapNativeToChainable:B})}})()}).call(this);}).call(this); |
@@ -1,2 +0,2 @@ | ||
// Type definitions for Sugar v2.0.4 | ||
// Type definitions for Sugar v2.0.5 | ||
// Project: https://sugarjs.com/ | ||
@@ -3,0 +3,0 @@ // Definitions by: Andrew Plummer <plummer.andrew@gmail.com> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
189304
3449
1
10