prc b6c02717e6 Upload complete no-internet building environment. | 1 jaar geleden | |
---|---|---|
.. | ||
.github | 1 jaar geleden | |
test | 1 jaar geleden | |
.editorconfig | 1 jaar geleden | |
.eslintignore | 1 jaar geleden | |
.eslintrc | 1 jaar geleden | |
.gitattributes | 1 jaar geleden | |
.nycrc | 1 jaar geleden | |
CHANGELOG.md | 1 jaar geleden | |
LICENSE | 1 jaar geleden | |
README.md | 1 jaar geleden | |
index.js | 1 jaar geleden | |
package.json | 1 jaar geleden |
Is this value a JS WeakSet? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isWeakSet = require('is-weakset');
assert(!isWeakSet(function () {}));
assert(!isWeakSet(null));
assert(!isWeakSet(function* () { yield 42; return Infinity; });
assert(!isWeakSet(Symbol('foo')));
assert(!isWeakSet(1n));
assert(!isWeakSet(Object(1n)));
assert(!isWeakSet(new Set()));
assert(!isWeakSet(new WeakMap()));
assert(!isWeakSet(new Map()));
assert(isWeakSet(new WeakSet()));
class MyWeakSet extends WeakSet {}
assert(isWeakSet(new MyWeakSet()));
Simply clone the repo, npm install
, and run npm test