For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/predicate/isWeakSet.md.

isWeakSet es-toolkit

Checks if a given value is a WeakSet instance.

const result = isWeakSet(value);

Usage

isWeakSet(value)

Use isWeakSet when you want to check if a value is a WeakSet instance.

import { isWeakSet } from 'es-toolkit/predicate';

// WeakSet instances
const weakSet1 = new WeakSet();
const weakSet2 = new WeakSet([{}, []]);

console.log(isWeakSet(weakSet1)); // true
console.log(isWeakSet(weakSet2)); // true

// Non-WeakSet values
console.log(isWeakSet(new Set())); // false
console.log(isWeakSet(new Map())); // false
console.log(isWeakSet(new WeakMap())); // false
console.log(isWeakSet([])); // false
console.log(isWeakSet({})); // false
console.log(isWeakSet(null)); // false
console.log(isWeakSet(undefined)); // false

Parameters

valueunknownrequired

The value to check if it's a WeakSet instance.

Returns

Returns true if the value is a WeakSet instance, false otherwise.

value is WeakSet<WeakKey>
Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.