import { ElementOf, IsEmpty, List } from "../../list"; import { Satisfies, Unreachable } from "../../type"; import { $, HKT, _, I } from ".."; type _$All
, L extends List> = L extends readonly [...infer Init, infer Last] ? $
extends true ? _$All
: false : $
> extends true ? true : false; /** * checks whether all elements of list `L` satisfy predicate `P`. * * an empty list is vacuously satisfied (i.e. returns true) * * @param P - HKT predicate to operate on each individual element of `L` * @param L - the list to search * * @since 0.0.2 */ export type $All
, L extends List> = IsEmpty extends true ? $All : false : L extends readonly [...any, any] ? _$All : L extends {
0?: any;
} ? L extends readonly [_?: infer H, ...__: infer T] ? $ extends true ? $All : false : Unreachable : $ > extends true ? true : false;
/**
* checks whether all elements of the input list satisfy predicate `P`
*
* an empty list is vacuously satisfied (i.e. returns false)
*
* @since 0.0.2
*/
export interface All > extends HKT {
[HKT.i]: Satisfies<_ >;
}
export {};
//# sourceMappingURL=all.d.ts.map