Given a Type Guard, returns a Type Guard that checks if the given value is a Record and all its entries match the given Type Guard.
import { guardRecord } from "type-guard-helpers"const test = {} as unknown;const isTranslation = guardRecord( (val): val is { readonly translation: string } => !!val.translation);if (isTranslation(test)) { test; // { readonly translation: string; }}
Generated using TypeDoc
Given a Type Guard, returns a Type Guard that checks if the given value is a Record and all its entries match the given Type Guard.
Example