effect-io-ai

Package: effect
Module: Predicate

Predicate.isMap

Checks whether a value is a Map.

When to use

Use when you need a Predicate runtime guard for Map values.

Details

Uses instanceof Map.

Example (Guarding a Map)

import { Predicate } from "effect"

const data: unknown = new Map([["a", 1]])

if (Predicate.isMap(data)) {
  console.log(data.size)
}

See

Signature

declare const isMap: (input: unknown) => input is Map<unknown, unknown>

Source

Since v2.0.0