es6-collections
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,4 +0,4 @@ | ||
(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&& | ||
(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&&t.call(this,a)}b||u(a,"size",{get:v});a.constructor=e;e.prototype=a;return e}function t(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--&&!w(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 x(){return this._keys.slice()}function v(){return this._values.length}function y(a,b){var e= | ||
this,c=e._values.slice();e._keys.slice().forEach(function(d,f){a.call(b,c[f],d,e)})}function z(a,b){var c=this;c._values.slice().forEach(function(d){a.call(b,d,d,c)})}var c,u=Object.defineProperty,w=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:x,values:r,forEach:y,clear:h}));"undefined"==typeof Set&&(d.Set=f({has:m,add:q,"delete":g,clear:h,values:r,forEach:z}));"undefined"==typeof WeakSet&& | ||
(d.WeakSet=f({"delete":g,add:q,clear:h,has:m},!0))})("undefined"!=typeof exports&&"undefined"!=typeof global?global:window); |
{ | ||
"name": "es6-collections", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "ES6 Harmony like collections such Map, WeakMap, and Set", | ||
@@ -41,4 +41,4 @@ "homepage": "https://github.com/WebReflection/es6-collections", | ||
"build": "npm run minify && npm run test", | ||
"minify": "ccjs index.js > es6-collections.js", | ||
"test": "mocha" | ||
"minify": "./node_modules/closurecompiler/bin/ccjs index.js > es6-collections.js", | ||
"test": "./node_modules/mocha/bin/mocha" | ||
}, | ||
@@ -45,0 +45,0 @@ "testling": { |
@@ -19,3 +19,3 @@ ES6 Harmony Collections [![build status](https://secure.travis-ci.org/WebReflection/es6-collections.png)](http://travis-ci.org/WebReflection/es6-collections) | ||
* **size and performances oriented** polyfill. It does not matter if the WeakMap is not perfect, it's just fast and not much more memory leaks prone than other shims. If you don't rely on magic, simply remember to `weakmap.delete(referedObject)` when *referedObject* is not needed anymore. | ||
* for browsers, it fits in **less than 1Kb** [once minzipped](https://github.com/WebReflection/es6-collections/blob/master/es6-collections.min.js) ... the smallest shim out there so far | ||
* for browsers, it fits in **less than 1Kb** [once minzipped](https://github.com/WebReflection/es6-collections/blob/master/es6-collections.js) ... the smallest shim out there so far | ||
* 100% of code coverage | ||
@@ -22,0 +22,0 @@ * completely private shared behavior in order to easily maintain and update three collections at once |
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
25224