Skip to content

isSet

Returns true for Set instances

122 bytes

Usage

Returns true for Set instances, even if they are subclass instances or from other realms.

import * as
import _
_
from 'radashi'
import _
_
.
isSet<Set<unknown>>(value: Set<unknown>): value is Set<unknown>
export isSet

Checks if the given value is a Set.

Instances from other realms are also supported.

@seehttps://radashi.js.org/reference/typed/isSet

@example

isSet(new Set([1, 2, 3])) // => true
isSet(new Map([1, 2, 3])) // => false

@version12.2.0

isSet
(new
var Set: SetConstructor
new <unknown>(iterable?: Iterable<unknown> | null | undefined) => Set<unknown> (+1 overload)
Set
()) // true
import _
_
.
isSet<(Anonymous class)>(value: (Anonymous class)): value is (Anonymous class)
export isSet

Checks if the given value is a Set.

Instances from other realms are also supported.

@seehttps://radashi.js.org/reference/typed/isSet

@example

isSet(new Set([1, 2, 3])) // => true
isSet(new Map([1, 2, 3])) // => false

@version12.2.0

isSet
(new (class extends
var Set: SetConstructor
Set
{})()) // true