Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es6set-operations

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6set-operations - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

15

lib/index.js
// 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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc