tree: 5dbe0ea15bed292f020f2f0a40d8e4a60e507b3f [path history] [tgz]
  1. .github/
  2. test/
  3. .editorconfig
  4. .eslintrc
  5. .gitattributes
  6. .nycrc
  7. CHANGELOG.md
  8. index.d.ts
  9. index.js
  10. LICENSE
  11. package.json
  12. README.md
  13. tsconfig.json
node_modules/is-set/README.md

is-set Version Badge

github actions coverage License Downloads

npm badge

Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

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()));

Tests

Simply clone the repo, npm install, and run npm test