chore(ts-toolbelt): remove deprecated test (#37932)

This commit is contained in:
Pierre-Antoine Mills 2020-04-13 21:32:01 +02:00 committed by GitHub
parent 141ee01c8c
commit eb569a5c74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ type StdRecursiveIteration<T extends any[], I extends I.Iteration = I.IterationO
I.Pos<I> extends T.Length<T> // this form of recursion is preferred
? 1 // because it will let the user know if
: 0 // the instantiation depth has been hit
]; // (but error is sometimes swallowed (?))
];
checks([
check<StdRecursiveIteration<[
@ -22,23 +22,3 @@ checks([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]>, 40, Test.Pass>(), // max length is 40
]);
// iterates over `T` and returns the `Iteration` position when finished
type SafeRecursiveIteration<T extends any[], I extends I.Iteration = I.IterationOf<'0'>> = {
0: SafeRecursiveIteration<T, I.Next<I>>;
1: I.Pos<I>;
}[
I.Key<I> extends T.Length<T, 's'> // this form of recursion is the safest
? 1 // because `T.Length<T, 's'>` will force
: 0 // the length to comply with the limits
]; // => won't compute if excessive length
checks([
check<SafeRecursiveIteration<[
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]>, 0, Test.Pass>() // did not compute
]);