Fix unfold step function return type (#18692)

This commit is contained in:
Miika Hänninen 2017-08-09 00:46:39 +03:00 committed by Mohamed Hegazy
parent f6e30f1669
commit 7f30cbcfe9
2 changed files with 3 additions and 3 deletions

View File

@ -1833,8 +1833,8 @@ declare namespace R {
* to stop iteration or an array of length 2 containing the value to add to the resulting
* list and the seed to be used in the next call to the iterator function.
*/
unfold<T, TResult>(fn: (seed: T) => TResult[] | boolean, seed: T): TResult[];
unfold<T, TResult>(fn: (seed: T) => TResult[] | boolean): (seed: T) => TResult[];
unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false, seed: T): TResult[];
unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false): (seed: T) => TResult[];
/**
* Combines two lists into a set (i.e. no duplicates) composed of the

View File

@ -391,7 +391,7 @@ R.times(i, 5);
R.take(2, [1, 2, 3, 4]); // => [1, 2]
});
(() => {
function f(n: number) {
function f(n: number): false | [number, number] {
return n > 50 ? false : [-n, n + 10];
}