es6-collections
Advanced tools
Comparing version 0.3.4 to 0.4.0
(function(d){function f(a,b){function e(a){if(!this||this.constructor!==e)return new e(a);this._keys=[];this._values=[];this.objectOnly=b;a&&s.call(this,a)}b||t(a,"size",{get:u});a.constructor=e;e.prototype=a;return e}function s(a){this.add?a.forEach(this.add,this):a.forEach(function(a){this.set(a[0],a[1])},this)}function g(a){this.has(a)&&(this._keys.splice(c,1),this._values.splice(c,1));return-1<c}function k(a){return this.has(a)?this._values[c]:void 0}function l(a,b){if(this.objectOnly&&b!==Object(b))throw new TypeError("Invalid value used as weak collection key"); | ||
if(b!=b||0===b)for(c=a.length;c--&&!v(a[c],b););else c=a.indexOf(b);return-1<c}function m(a){return l.call(this,this._values,a)}function n(a){return l.call(this,this._keys,a)}function p(a,b){this.has(a)?this._values[c]=b:this._values[this._keys.push(a)-1]=b;return this}function q(a){this.has(a)||this._values.push(a);return this}function h(){this._values.length=0}function r(){return this._values.slice()}function w(){return this._keys.slice()}function u(){return this._values.length}function x(a,b){var e= | ||
this,c=e._values.slice();e._keys.slice().forEach(function(d,f){a.call(b,d,c[f],e)})}function y(a,b){var c=this;c._values.slice().forEach(function(d){a.call(b,d,d,c)})}var c,t=Object.defineProperty,v=Object.is;"undefined"==typeof WeakMap&&(d.WeakMap=f({"delete":g,clear:h,get:k,has:n,set:p},!0));"undefined"==typeof Map&&(d.Map=f({"delete":g,has:n,get:k,set:p,keys:w,values:r,forEach:x,clear:h}));"undefined"==typeof Set&&(d.Set=f({has:m,add:q,"delete":g,clear:h,values:r,forEach:y}));"undefined"==typeof WeakSet&& | ||
(d.WeakSet=f({"delete":g,add:q,clear:h,has:m},!0))})("undefined"==typeof exports?window:global); | ||
(d.WeakSet=f({"delete":g,add:q,clear:h,has:m},!0))})("undefined"!=typeof exports&&"undefined"!=typeof global?global:window); |
@@ -187,3 +187,3 @@ (function (exports) {'use strict'; | ||
self._keys.slice().forEach(function(key, n){ | ||
callback.call(context, key, values[n], self); | ||
callback.call(context, values[n], key, self); | ||
}); | ||
@@ -199,2 +199,2 @@ } | ||
})(typeof exports == 'undefined' ? window : global); | ||
})(typeof exports != 'undefined' && typeof global != 'undefined' ? global : window ); |
{ | ||
"name": "es6-collections", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "ES6 Harmony like collections such Map, WeakMap, and Set", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/WebReflection/es6-collections", |
@@ -231,3 +231,3 @@ var assert = require('better-assert'); | ||
if ("forEach" in o) { | ||
o.forEach(function (key, value, obj) { | ||
o.forEach(function (value, key, obj) { | ||
assert(key === "key " + value); | ||
@@ -395,2 +395,2 @@ assert(obj === o); | ||
}); | ||
}); | ||
}); |
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
25168
535