assertMapSize
assertMapSize
Section titled “assertMapSize”Assert that a Map has exactly the expected size, with type narrowing.
import { assertMapSize } from "@kensio/smartass";
const value: unknown = new Map([["role", "admin"]]);
assertMapSize(value, 1);
// value is now narrowed to a Map with exactly 1 entrySource
Section titled “Source”Source file: src/assert/map-size/map-size.assert.ts
