is-weakset (2.0.4)

Published 2026-02-24 13:58:44 +00:00 by atheaadmin

Installation

registry=
npm install is-weakset@2.0.4
"is-weakset": "2.0.4"

About this package

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

Dependencies

Dependencies

ID Version
call-bound ^1.0.3
get-intrinsic ^1.2.6

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.1
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.2
@types/for-each ^0.3.3
@types/get-intrinsic ^1.2.3
@types/object-inspect ^1.13.0
@types/tape ^5.7.0
auto-changelog ^2.5.0
core-js ^2.6.12
encoding ^0.1.13
es5-shim ^4.6.7
es6-shim ^0.35.8
eslint =8.8.0
for-each ^0.3.3
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
object-inspect ^1.13.3
safe-publish-latest ^2.0.0
tape ^5.9.0
typescript next

Keywords

map weakmap set weakset collection is robust
Details
npm
2026-02-24 13:58:44 +00:00
0
Jordan Harband
MIT
latest
7.3 KiB
Assets (1)
Versions (1) View all
2.0.4 2026-02-24