Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 490 Bytes

set.md

File metadata and controls

27 lines (18 loc) · 490 Bytes

Set

Set instance

set/is

Confirms if given object is a native set_

const isSet = require("type/set/is");

isSet(new Set()); // true
isSet(new Map()); // false
isSet({}); // false

Set/ensure

If given argument is a set, it is returned back. Otherwise TypeError is thrown.

const ensureSet = require("type/set/ensure");

const set = new Set();
ensureSet(set); // set
eensureSet({}); // Thrown TypeError: [object Object] is not a set