Set instance
Confirms if given object is a native set_
const isSet = require("type/set/is");
isSet(new Set()); // true
isSet(new Map()); // false
isSet({}); // false
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