import { isMap } from "https://deno.land/x/unknownutil@v3.18.1/is.ts";
Return true
if the type of x
is Map<unknown, unknown>
.
import { is } from "@core/unknownutil";
const a: unknown = new Map([["a", 0], ["b", 1]]);
if (is.Map(a)) {
// a is narrowed to Map<unknown, unknown>
const _: Map<unknown, unknown> = a;
}