Given a Type Guard, returns a Type Guard that checks if the given value is an array and matches the given Type Guard.
import { guardArray } from 'type-guard-helpers';const isStringArray = guardArray( (value): value is readonly string[] => value.findIndex((item) => typeof item !== 'string') === -1);const test = {} as unknown;if (isStringArray(test)) { test; // test: readonly string[]}
Generated using TypeDoc
Given a Type Guard, returns a Type Guard that checks if the given value is an array and matches the given Type Guard.
Example