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