es6set-operations
Advanced tools
Comparing version 0.0.1 to 0.0.2
// All elements of A (this) that also belong to B (other) | ||
function intersection(other) { | ||
var self = this; | ||
function intersection(set, other) { | ||
return new Set(other.toArray().filter(function(value) { | ||
return self.has(value); | ||
return set.has(value); | ||
})); | ||
@@ -11,12 +10,11 @@ } | ||
// Returns the set of objects in other (B) but not in this (A) | ||
function difference(other) { | ||
var self = this; | ||
function difference(set, other) { | ||
return new Set(other.toArray().filter(function(value) { | ||
return !self.has(value); | ||
return !set.has(value); | ||
})); | ||
} | ||
function toArray() { | ||
function toArray(set) { | ||
var array = []; | ||
this.forEach(function(value) { | ||
set.forEach(function(value) { | ||
array.push(value); | ||
@@ -27,2 +25,3 @@ }); | ||
module.exports = { | ||
@@ -29,0 +28,0 @@ toArray: toArray, |
{ | ||
"name": "es6set-operations", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Set operations for ES6 sets", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.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
2195
25