prc b6c02717e6 Upload complete no-internet building environment. | vor 1 Jahr | |
---|---|---|
.. | ||
.github | vor 1 Jahr | |
test | vor 1 Jahr | |
.editorconfig | vor 1 Jahr | |
.eslintignore | vor 1 Jahr | |
.eslintrc | vor 1 Jahr | |
.gitattributes | vor 1 Jahr | |
.nycrc | vor 1 Jahr | |
CHANGELOG.md | vor 1 Jahr | |
LICENSE | vor 1 Jahr | |
README.md | vor 1 Jahr | |
index.js | vor 1 Jahr | |
package.json | vor 1 Jahr |
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