1.0.4 • Published 1 year ago

extended-set v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Extended Set

Extended Set is a small package that allows you to pass in an array of values instead of calling Set.has() multiple times yourself.

Usage

Set.includes() returns true if all given values are present in the set.

import "extended-set"

const x = new Set([1, 2, 3, 4])

if(x.includes([1, 3])){ // Will return true because 1 and 3 are in the set.
	// Do something
}

Set.some() returns true if a single value is present in the set.

import "extended-set"

const x = new Set([1, 2, 3, 4])

if(x.some([6, 5, 4])) { // Will return true because 4 is in the set.
	// Do something
}
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

0.0.1

1 year ago