Skip to content

isEmpty

ts
function Map.isEmpty<T, U>(target: ReadonlyMap<T, U>): boolean

Checks whether the map is empty (contains no entries).

Example

ts
import { Map } from "@monstermann/map";

Map.isEmpty(new Map()); // true
Map.isEmpty(new Map([["a", 1]])); // false
ts
import { Map } from "@monstermann/map";

pipe(new Map(), Map.isEmpty()); // true
pipe(new Map([["a", 1]]), Map.isEmpty()); // false