Corrects documentation in core-js

Updates the documentation for Array.prototype.findIndex. findIndex
returns -1 on failure, not undefined.
This commit is contained in:
Lars Lønne
2017-03-08 11:17:19 +01:00
parent a0a315592f
commit cb23d157a6

6
core-js/index.d.ts vendored
View File

@@ -111,11 +111,11 @@ interface Array<T> {
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
/**
* Returns the index of the first element in the array where predicate is true, and undefined
* Returns the index of the first element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* immediately returns that element value. Otherwise, find returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
@@ -827,7 +827,7 @@ interface PromiseConstructor {
all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.