UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

26 lines (24 loc) 441 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/map/isMap.ts /** * `isMap(target)` * * Checks if `target` is a Map instance. * * ```ts * isMap(new Map()); // true * isMap({}); // false * isMap([]); // false * ``` * * ```ts * pipe(new Map(), isMap()); // true * pipe({}, isMap()); // false * pipe([], isMap()); // false * ``` */ const isMap = dfdlT((target) => { return target instanceof Map; }, 1); //#endregion export { isMap };