is-set
Is this value a JS Set? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Last updated 4 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-set 
SYNC missed versions from official npm registry.

is-set Version Badge

dependency status dev dependency status 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

Current Tags

  • 2.0.2                                ...           latest (4 years ago)

4 Versions

  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 3
Last Month 0
Dependencies (0)
None
Dev Dependencies (12)

Copyright 2013 - present © cnpmjs.org | Home |