Comparing version 0.1.0 to 0.1.1
@@ -1,20 +0,1 @@ | ||
if (typeof Map === "undefined") { | ||
Map = function() { this.clear(); }; | ||
Map.prototype = { | ||
set: function(k, v) { this._[k] = v; return this; }, | ||
get: function(k) { return this._[k]; }, | ||
has: function(k) { return k in this._; }, | ||
delete: function(k) { return k in this._ && delete this._[k]; }, | ||
clear: function() { this._ = Object.create(null); }, | ||
get size() { var n = 0; for (var k in this._) ++n; return n; }, | ||
forEach: function(c) { for (var k in this._) c(this._[k], k, this); } | ||
}; | ||
} else (function() { | ||
var m = new Map; | ||
if (m.set(0, 0) !== m) { | ||
m = m.set; | ||
Map.prototype.set = function() { m.apply(this, arguments); return this; }; | ||
} | ||
})(); | ||
(function (global, factory) { | ||
@@ -21,0 +2,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
@@ -1,1 +0,1 @@ | ||
"undefined"==typeof Map?(Map=function(){this.clear()},Map.prototype={set:function(n,t){return this._[n]=t,this},get:function(n){return this._[n]},has:function(n){return n in this._},"delete":function(n){return n in this._&&delete this._[n]},clear:function(){this._=Object.create(null)},get size(){var n=0;for(var t in this._)++n;return n},forEach:function(n){for(var t in this._)n(this._[t],t,this)}}):function(){var n=new Map;n.set(0,0)!==n&&(n=n.set,Map.prototype.set=function(){return n.apply(this,arguments),this})}(),function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.arrays={})}(this,function(n){"use strict";function t(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){r=e;break}for(;++u<i;)null!=(e=n[u])&&r>e&&(r=e)}else{for(;++u<i;)if(null!=(e=t.call(n,n[u],u))&&e>=e){r=e;break}for(;++u<i;)null!=(e=t.call(n,n[u],u))&&r>e&&(r=e)}return r}function r(n){if(!(o=n.length))return[];for(var r=-1,u=t(n,e),i=new Array(u);++r<u;)for(var o,f=-1,a=i[r]=new Array(o);++f<o;)a[f]=n[f][r];return i}function e(n){return n.length}function u(){return r(arguments)}function i(n){return null===n?NaN:+n}function o(n,t){var r,e,u=n.length,o=0,f=0,a=-1,s=0;if(1===arguments.length)for(;++a<u;)isNaN(r=i(n[a]))||(e=r-o,o+=e/++s,f+=e*(r-o));else for(;++a<u;)isNaN(r=i(t.call(n,n[a],a)))||(e=r-o,o+=e/++s,f+=e*(r-o));return s>1?f/(s-1):void 0}function f(n){var t=[];for(var r in n)t.push(n[r]);return t}function a(n,t){var r,e=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(r=+n[i])||(e+=r);else for(;++i<u;)isNaN(r=+t.call(n,n[i],i))||(e+=r);return e}function s(n,t,r){(i=arguments.length)<3&&(r=n.length,2>i&&(t=0));for(var e,u,i=r-t;i;)u=Math.random()*i--|0,e=n[i+t],n[i+t]=n[u+t],n[u+t]=e;return n}function l(){}function c(n,t){var r=new l;if(n instanceof l)n.forEach(function(n,t){r.set(n,t)});else if(Array.isArray(n)){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)r.set(u,n[u]);else for(;++u<i;)r.set(t.call(n,e=n[u],u),e)}else for(var o in n)r.set(o,n[o]);return r}function h(){}function g(n){var t=new h;if(n)for(var r=0,e=n.length;e>r;++r)t.add(n[r]);return t}function v(n,t,r){(u=arguments.length)<3&&(r=1,2>u&&(t=n,n=0));var e=-1,u=0|Math.max(0,Math.ceil((t-n)/r)),i=p(Math.abs(r)),o=new Array(u);for(n*=i,r*=i;++e<u;)o[e]=(n+e*r)/i;return o}function p(n){for(var t=1;n*t%1;)t*=10;return t}function m(n,t){var r=(n.length-1)*t+1,e=Math.floor(r),u=+n[e-1],i=r-e;return i?u+i*(n[e]-u):u}function y(n,t){for(var r=t.length,e=new Array(r);r--;)e[r]=n[t[r]];return e}function d(n){for(var t,r=0,e=n.length-1,u=n[0],i=new Array(0>e?0:e);e>r;)i[r]=[t=u,u=n[++r]];return i}function N(){function n(t,o,f,a){if(o>=i.length)return e?e.call(u,t):r?t.sort(r):t;for(var s,l,h,g=-1,v=t.length,p=i[o++],m=c(),y=f();++g<v;)(h=m.get(s=p(l=t[g])+""))?h.push(l):m.set(s,[l]);return m.forEach(function(t,r){a(y,t,n(r,o,f,a))}),y}function t(n,r){if(r>=i.length)return n;var e=[],u=o[r++];return n.forEach(function(n,u){e.push({key:n,values:t(u,r)})}),u?e.sort(function(n,t){return u(n.key,t.key)}):e}var r,e,u,i=[],o=[];return u={object:function(t){return n(t,0,b,k)},map:function(t){return n(t,0,M,w)},entries:function(r){return t(n(r,0,M,w),0)},key:function(n){return i.push(n),u},sortKeys:function(n){return o[i.length-1]=n,u},sortValues:function(n){return r=n,u},rollup:function(n){return e=n,u}}}function b(){return{}}function k(n,t,r){n[t]=r}function M(){return c()}function w(n,t,r){n.set(t,r)}function _(n){for(var t,r,e,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(r=new Array(o);--u>=0;)for(e=n[u],t=e.length;--t>=0;)r[--o]=e[t];return r}function A(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function x(n,t){var r,e=[],u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)isNaN(r=i(n[o]))||e.push(r);else for(;++o<u;)isNaN(r=i(t.call(n,n[o],o)))||e.push(r);return e.length?m(e.sort(A),.5):void 0}function E(n,t){var r,e=0,u=n.length,o=-1,f=u;if(1===arguments.length)for(;++o<u;)isNaN(r=i(n[o]))?--f:e+=r;else for(;++o<u;)isNaN(r=i(t.call(n,n[o],o)))?--f:e+=r;return f?e/f:void 0}function j(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){r=e;break}for(;++u<i;)null!=(e=n[u])&&e>r&&(r=e)}else{for(;++u<i;)if(null!=(e=t.call(n,n[u],u))&&e>=e){r=e;break}for(;++u<i;)null!=(e=t.call(n,n[u],u))&&e>r&&(r=e)}return r}function z(n){var t=[];for(var r in n)t.push(r);return t}function q(n,t){var r,e,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(e=n[i])&&e>=e){r=u=e;break}for(;++i<o;)null!=(e=n[i])&&(r>e&&(r=e),e>u&&(u=e))}else{for(;++i<o;)if(null!=(e=t.call(n,n[i],i))&&e>=e){r=u=e;break}for(;++i<o;)null!=(e=t.call(n,n[i],i))&&(r>e&&(r=e),e>u&&(u=e))}return[r,u]}function O(n){var t=[];for(var r in n)t.push({key:r,value:n[r]});return t}function K(){var n=o.apply(this,arguments);return n?Math.sqrt(n):n}function L(n,t){return n>t?-1:t>n?1:t>=n?0:NaN}function R(n){return 1===n.length&&(n=V(n)),{left:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)<0?e=i+1:u=i}return e},right:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)>0?u=i:e=i+1}return e}}}function V(n){return function(t,r){return A(n(t),r)}}var $="$";l.prototype=c.prototype={has:function(n){return $+n in this},get:function(n){return this[$+n]},set:function(n,t){return this[$+n]=t},remove:function(n){var t=$+n;return t in this&&delete this[t]},keys:function(){var n=[];for(var t in this)t[0]===$&&n.push(t.slice(1));return n},values:function(){var n=[];for(var t in this)t[0]===$&&n.push(this[t]);return n},entries:function(){var n=[];for(var t in this)t[0]===$&&n.push({key:t.slice(1),value:this[t]});return n},size:function(){var n=0;for(var t in this)t[0]===$&&++n;return n},empty:function(){for(var n in this)if(n[0]===$)return!1;return!0},forEach:function(n){for(var t in this)t[0]===$&&n.call(this,t.slice(1),this[t])}};var B=c.prototype;h.prototype=g.prototype={has:B.has,add:function(n){return n+="",this[$+n]=!0,n},remove:B.remove,values:B.keys,size:B.size,empty:B.empty,forEach:function(n){for(var t in this)t[0]===$&&n.call(this,t.slice(1))}};var C=R(A),D=C.right,F=C.left;n.ascending=A,n.bisect=D,n.bisectLeft=F,n.bisectRight=D,n.bisector=R,n.descending=L,n.deviation=K,n.entries=O,n.extent=q,n.keys=z,n.map=c,n.max=j,n.mean=E,n.median=x,n.merge=_,n.min=t,n.nest=N,n.pairs=d,n.permute=y,n.quantile=m,n.range=v,n.set=g,n.shuffle=s,n.sum=a,n.transpose=r,n.values=f,n.variance=o,n.zip=u}); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.arrays={})}(this,function(n){"use strict";function r(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&t>e&&(t=e)}else{for(;++u<i;)if(null!=(e=r.call(n,n[u],u))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r.call(n,n[u],u))&&t>e&&(t=e)}return t}function t(n){if(!(o=n.length))return[];for(var t=-1,u=r(n,e),i=new Array(u);++t<u;)for(var o,f=-1,a=i[t]=new Array(o);++f<o;)a[f]=n[f][t];return i}function e(n){return n.length}function u(){return t(arguments)}function i(n){return null===n?NaN:+n}function o(n,r){var t,e,u=n.length,o=0,f=0,a=-1,l=0;if(1===arguments.length)for(;++a<u;)isNaN(t=i(n[a]))||(e=t-o,o+=e/++l,f+=e*(t-o));else for(;++a<u;)isNaN(t=i(r.call(n,n[a],a)))||(e=t-o,o+=e/++l,f+=e*(t-o));return l>1?f/(l-1):void 0}function f(n){var r=[];for(var t in n)r.push(n[t]);return r}function a(n,r){var t,e=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(t=+n[i])||(e+=t);else for(;++i<u;)isNaN(t=+r.call(n,n[i],i))||(e+=t);return e}function l(n,r,t){(i=arguments.length)<3&&(t=n.length,2>i&&(r=0));for(var e,u,i=t-r;i;)u=Math.random()*i--|0,e=n[i+r],n[i+r]=n[u+r],n[u+r]=e;return n}function s(){}function c(n,r){var t=new s;if(n instanceof s)n.forEach(function(n,r){t.set(n,r)});else if(Array.isArray(n)){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)t.set(u,n[u]);else for(;++u<i;)t.set(r.call(n,e=n[u],u),e)}else for(var o in n)t.set(o,n[o]);return t}function h(){}function g(n){var r=new h;if(n)for(var t=0,e=n.length;e>t;++t)r.add(n[t]);return r}function v(n,r,t){(u=arguments.length)<3&&(t=1,2>u&&(r=n,n=0));var e=-1,u=0|Math.max(0,Math.ceil((r-n)/t)),i=p(Math.abs(t)),o=new Array(u);for(n*=i,t*=i;++e<u;)o[e]=(n+e*t)/i;return o}function p(n){for(var r=1;n*r%1;)r*=10;return r}function m(n,r){var t=(n.length-1)*r+1,e=Math.floor(t),u=+n[e-1],i=t-e;return i?u+i*(n[e]-u):u}function y(n,r){for(var t=r.length,e=new Array(t);t--;)e[t]=n[r[t]];return e}function N(n){for(var r,t=0,e=n.length-1,u=n[0],i=new Array(0>e?0:e);e>t;)i[t]=[r=u,u=n[++t]];return i}function d(){function n(r,o,f,a){if(o>=i.length)return e?e.call(u,r):t?r.sort(t):r;for(var l,s,h,g=-1,v=r.length,p=i[o++],m=c(),y=f();++g<v;)(h=m.get(l=p(s=r[g])+""))?h.push(s):m.set(l,[s]);return m.forEach(function(r,t){a(y,r,n(t,o,f,a))}),y}function r(n,t){if(t>=i.length)return n;var e=[],u=o[t++];return n.forEach(function(n,u){e.push({key:n,values:r(u,t)})}),u?e.sort(function(n,r){return u(n.key,r.key)}):e}var t,e,u,i=[],o=[];return u={object:function(r){return n(r,0,k,b)},map:function(r){return n(r,0,w,A)},entries:function(t){return r(n(t,0,w,A),0)},key:function(n){return i.push(n),u},sortKeys:function(n){return o[i.length-1]=n,u},sortValues:function(n){return t=n,u},rollup:function(n){return e=n,u}}}function k(){return{}}function b(n,r,t){n[r]=t}function w(){return c()}function A(n,r,t){n.set(r,t)}function x(n){for(var r,t,e,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(t=new Array(o);--u>=0;)for(e=n[u],r=e.length;--r>=0;)t[--o]=e[r];return t}function M(n,r){return r>n?-1:n>r?1:n>=r?0:NaN}function E(n,r){var t,e=[],u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)isNaN(t=i(n[o]))||e.push(t);else for(;++o<u;)isNaN(t=i(r.call(n,n[o],o)))||e.push(t);return e.length?m(e.sort(M),.5):void 0}function z(n,r){var t,e=0,u=n.length,o=-1,f=u;if(1===arguments.length)for(;++o<u;)isNaN(t=i(n[o]))?--f:e+=t;else for(;++o<u;)isNaN(t=i(r.call(n,n[o],o)))?--f:e+=t;return f?e/f:void 0}function j(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&e>t&&(t=e)}else{for(;++u<i;)if(null!=(e=r.call(n,n[u],u))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r.call(n,n[u],u))&&e>t&&(t=e)}return t}function q(n){var r=[];for(var t in n)r.push(t);return r}function K(n,r){var t,e,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(e=n[i])&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=n[i])&&(t>e&&(t=e),e>u&&(u=e))}else{for(;++i<o;)if(null!=(e=r.call(n,n[i],i))&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=r.call(n,n[i],i))&&(t>e&&(t=e),e>u&&(u=e))}return[t,u]}function L(n){var r=[];for(var t in n)r.push({key:t,value:n[t]});return r}function R(){var n=o.apply(this,arguments);return n?Math.sqrt(n):n}function V(n,r){return n>r?-1:r>n?1:r>=n?0:NaN}function $(n){return 1===n.length&&(n=B(n)),{left:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)<0?e=i+1:u=i}return e},right:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)>0?u=i:e=i+1}return e}}}function B(n){return function(r,t){return M(n(r),t)}}var C="$";s.prototype=c.prototype={has:function(n){return C+n in this},get:function(n){return this[C+n]},set:function(n,r){return this[C+n]=r},remove:function(n){var r=C+n;return r in this&&delete this[r]},keys:function(){var n=[];for(var r in this)r[0]===C&&n.push(r.slice(1));return n},values:function(){var n=[];for(var r in this)r[0]===C&&n.push(this[r]);return n},entries:function(){var n=[];for(var r in this)r[0]===C&&n.push({key:r.slice(1),value:this[r]});return n},size:function(){var n=0;for(var r in this)r[0]===C&&++n;return n},empty:function(){for(var n in this)if(n[0]===C)return!1;return!0},forEach:function(n){for(var r in this)r[0]===C&&n.call(this,r.slice(1),this[r])}};var D=c.prototype;h.prototype=g.prototype={has:D.has,add:function(n){return n+="",this[C+n]=!0,n},remove:D.remove,values:D.keys,size:D.size,empty:D.empty,forEach:function(n){for(var r in this)r[0]===C&&n.call(this,r.slice(1))}};var F=$(M),G=F.right,H=F.left;n.ascending=M,n.bisect=G,n.bisectLeft=H,n.bisectRight=G,n.bisector=$,n.descending=V,n.deviation=R,n.entries=L,n.extent=K,n.keys=q,n.map=c,n.max=j,n.mean=z,n.median=E,n.merge=x,n.min=r,n.nest=d,n.pairs=N,n.permute=y,n.quantile=m,n.range=v,n.set=g,n.shuffle=l,n.sum=a,n.transpose=t,n.values=f,n.variance=o,n.zip=u}); |
{ | ||
"name": "d3-arrays", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Array manipulation, ordering, searching, summarizing, etc.", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"scripts": { | ||
"pretest": "mkdir -p build && d3-bundler --polyfill-map --format=umd --name=arrays -- index.js > build/arrays.js", | ||
"pretest": "mkdir -p build && d3-bundler --format=umd --name=arrays -- index.js > build/arrays.js", | ||
"test": "faucet `find test -name '*-test.js'`", | ||
@@ -28,0 +28,0 @@ "prepublish": "npm run test && uglifyjs build/arrays.js -c -m -o build/arrays.min.js && rm -f build/arrays.zip && zip -j build/arrays.zip -- LICENSE README.md build/arrays.js build/arrays.min.js" |
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
64388
937