Bakhtina Sofya b84cb877be 1st comm | há 3 semanas atrás | |
---|---|---|
.. | ||
.github | há 3 semanas atrás | |
test | há 3 semanas atrás | |
.eslintignore | há 3 semanas atrás | |
.eslintrc | há 3 semanas atrás | |
.nycrc | há 3 semanas atrás | |
CHANGELOG.md | há 3 semanas atrás | |
LICENSE | há 3 semanas atrás | |
README.md | há 3 semanas atrás | |
index.js | há 3 semanas atrás | |
package.json | há 3 semanas atrás |
[![npm badge][11]][1]
Is this value a JS WeakRef? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isWeakRef = require('is-weakref');
assert(!isWeakRef(function () {}));
assert(!isWeakRef(null));
assert(!isWeakRef(function* () { yield 42; return Infinity; });
assert(!isWeakRef(Symbol('foo')));
assert(!isWeakRef(1n));
assert(!isWeakRef(Object(1n)));
assert(!isWeakRef(new Set()));
assert(!isWeakRef(new WeakSet()));
assert(!isWeakRef(new Map()));
assert(!isWeakRef(new WeakMap()));
assert(isWeakRef(new WeakRef({})));
class MyWeakRef extends WeakRef {}
assert(isWeakRef(new MyWeakRef({})));
Simply clone the repo, npm install
, and run npm test