[d24f17c] | 1 | import { Match } from '../Any/_Internal';
|
---|
| 2 | import { UnionOf } from '../Object/UnionOf';
|
---|
| 3 | import { Next } from '../Iteration/Next';
|
---|
| 4 | import { Prev } from '../Iteration/Prev';
|
---|
| 5 | import { Iteration } from '../Iteration/Iteration';
|
---|
| 6 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
| 7 | import { Is } from '../Any/Is';
|
---|
| 8 | import { Boolean } from '../Boolean/_Internal';
|
---|
| 9 | import { Cast } from '../Any/Cast';
|
---|
| 10 | import { Pos } from '../Iteration/Pos';
|
---|
| 11 | /**
|
---|
| 12 | * @hidden
|
---|
| 13 | */
|
---|
| 14 | declare type _IncludesDeep<O, M extends any, match extends Match, limit extends number, I extends Iteration = IterationOf<0>> = {
|
---|
| 15 | 0: _IncludesDeep<O extends object ? UnionOf<O> : O, M, match, limit, Next<I>>;
|
---|
| 16 | 1: 1;
|
---|
| 17 | 2: 0;
|
---|
| 18 | }[Pos<Prev<I>> extends limit ? 2 : Is<O, M, match>];
|
---|
| 19 | /**
|
---|
| 20 | * Check whether `O`, or its sub-objects have fields that match `M`
|
---|
| 21 | * where the maximum allowed depth is set with `limit`.
|
---|
| 22 | *
|
---|
| 23 | * @param O to be inspected
|
---|
| 24 | * @param M to check field type
|
---|
| 25 | * @param match (?=`'default'`) to change precision
|
---|
| 26 | * @param limit (?=`'10'`) to change the check depth
|
---|
| 27 | * @returns [[Boolean]]
|
---|
| 28 | * @example
|
---|
| 29 | * ```ts
|
---|
| 30 | * ```
|
---|
| 31 | * @author millsp, ctrlplusb
|
---|
| 32 | */
|
---|
| 33 | export declare type IncludesDeep<O extends object, M extends any, match extends Match = 'default', limit extends number = 10> = _IncludesDeep<O, M, match, limit> extends infer X ? Cast<X, Boolean> : never;
|
---|
| 34 | export {};
|
---|