types.isMap - Node documentation
function types.isMap

Usage in Deno

import { types } from "node:util";
const { isMap } = types;
isMap<T>(object: T | { }): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>) : Map<unknown, unknown>

Returns true if the value is a built-in Map instance.

util.types.isMap(new Map());  // Returns true

Type Parameters

T

Parameters

object: T | { }

Return Type

object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>) : Map<unknown, unknown>