unique-stream
Advanced tools
Comparing version 2.0.2 to 2.1.0
25
index.js
@@ -0,3 +1,18 @@ | ||
'use strict'; | ||
var filter = require('through2-filter').obj; | ||
var Set = require('es6-set'); | ||
var ES6Set; | ||
if (typeof global.Set === 'function') { | ||
ES6Set = global.Set; | ||
} else { | ||
ES6Set = function() { | ||
this.keys = []; | ||
this.has = function(val) { | ||
return this.keys.indexOf(val) !== -1; | ||
}, | ||
this.add = function(val) { | ||
this.keys.push(val); | ||
} | ||
} | ||
} | ||
@@ -12,3 +27,3 @@ function prop(propName) { | ||
function unique(propName, keyStore) { | ||
keyStore = keyStore || new Set(); | ||
keyStore = keyStore || new ES6Set(); | ||
@@ -27,7 +42,7 @@ var keyfn = JSON.stringify; | ||
return false; | ||
} else { | ||
keyStore.add(key); | ||
return true; | ||
} | ||
keyStore.add(key); | ||
return true; | ||
}); | ||
} |
{ | ||
"name": "unique-stream", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "node.js through stream that emits a unique stream of objects based on criteria", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node_modules/.bin/mocha" | ||
"test": "mocha" | ||
}, | ||
@@ -22,11 +22,10 @@ "repository": { | ||
"license": "BSD", | ||
"dependencies": { | ||
"through2-filter": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"after": "~0.8.1", | ||
"chai": "^1.10.0", | ||
"chai": "^3.0.0", | ||
"mocha": "^2.1.0" | ||
}, | ||
"dependencies": { | ||
"es6-set": "^0.1.1", | ||
"through2-filter": "^1.4.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # unique-stream | ||
[![build status](https://secure.travis-ci.org/eugeneware/unique-stream.png)](http://travis-ci.org/eugeneware/unique-stream) | ||
[![Build Status](https://travis-ci.org/eugeneware/unique-stream.svg?branch=master)](https://travis-ci.org/eugeneware/unique-stream) | ||
@@ -8,0 +8,0 @@ ## Installation |
Sorry, the diff of this file is not supported yet
9970
1
160
- Removedes6-set@^0.1.1
- Removedd@1.0.2(transitive)
- Removedes5-ext@0.10.64(transitive)
- Removedes6-iterator@2.0.3(transitive)
- Removedes6-set@0.1.6(transitive)
- Removedes6-symbol@3.1.4(transitive)
- Removedesniff@2.0.1(transitive)
- Removedevent-emitter@0.3.5(transitive)
- Removedext@1.7.0(transitive)
- Removednext-tick@1.1.0(transitive)
- Removedtype@2.7.2(transitive)