Given one or multiple Type Guards as arguments, returns a Type Guard to check if a value matches at least one of the given Type Guard(s). Same as guardEitherIn, but accepts multiple arguments instead of a single array
import { isNull, match, guardEither, isTypeString } from 'type-guard-helpers';const isStringOrNull = guardEither(isNull, isTypeString);const test = {} as unknown;if (isStringOrNull(test)) { test; // string || null}
Rest
Generated using TypeDoc
Given one or multiple Type Guards as arguments, returns a Type Guard to check if a value matches at least one of the given Type Guard(s). Same as guardEitherIn, but accepts multiple arguments instead of a single array
Example