liup a01a5aa773 | vor 3 Wochen | |
---|---|---|
.. | ||
.github | vor 3 Wochen | |
test | vor 3 Wochen | |
.editorconfig | vor 3 Wochen | |
.eslintrc | vor 3 Wochen | |
.gitattributes | vor 3 Wochen | |
.nycrc | vor 3 Wochen | |
CHANGELOG.md | vor 3 Wochen | |
LICENSE | vor 3 Wochen | |
README.md | vor 3 Wochen | |
index.d.ts | vor 3 Wochen | |
index.js | vor 3 Wochen | |
package.json | vor 3 Wochen | |
tsconfig.json | vor 3 Wochen |
Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isSet = require('is-set');
assert(!isSet(function () {}));
assert(!isSet(null));
assert(!isSet(function* () { yield 42; return Infinity; });
assert(!isSet(Symbol('foo')));
assert(!isSet(1n));
assert(!isSet(Object(1n)));
assert(!isSet(new Map()));
assert(!isSet(new WeakSet()));
assert(!isSet(new WeakMap()));
assert(isSet(new Set()));
class MySet extends Set {}
assert(isSet(new MySet()));
Simply clone the repo, npm install
, and run npm test