imajin/node_modules/is-weakset
2026-01-10 04:52:11 -08:00
..
.github chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
test chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
.editorconfig chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
.eslintrc chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
.gitattributes chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
.nycrc chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
CHANGELOG.md chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
index.d.ts chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
index.js chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
LICENSE chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
package.json chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
README.md chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
tsconfig.json chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00

is-weakset Version Badge

github actions coverage License Downloads

npm badge

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

Example

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

Tests

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