Skip to content

Gozala/interset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interset

Build Status

Browser support

Binary operations for logical sets in our case arrays, although in a future support for upcoming sets maybe added.

API

union

Return a set that is the union of the input sets.

union

var union = require("interset/union")

union()
// => []

union([1, 2])
// => [1, 2]

union([1, 2], [2, 3])
// => [1, 2, 3]

union([1, 2], [2, 3], [3, 4])
// => [1, 2, 3, 4]

intersection

Return a set that is the intersection of the input sets.

intersection

intersection()
// => TypeError: intersection requires at least one argument

intersection([1])
// => [1]

intersection([1, 2], [2, 3])
// => [2]

intersection([1, 2], [2, 3], [3, 4])
// => []

intersection([1, "a"], ["a", 3], ["a"])
// => ["a"]

difference

Return a set that is the first set without elements of the remaining sets

difference

var difference = require("interset/difference")

difference()
// => TypeError: difference requires at least one arguments

difference([1, 2, 3])
// => [1, 2, 3]

difference([1, 2], [2, 3])
// => [1]

difference([1, 2, 3], [1], [1, 4], [3])
// => [2]

Install

npm install interset

About

Binary operations for logical sets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors