From cdb0fb324fbfcde07306bc0ca42f321f3977ed87 Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Sat, 4 Jun 2016 03:26:17 -0700 Subject: [PATCH 1/2] Fix findIndex documentation. --- src/lib/es2015.core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 206b8b8f9bf..74026a6baeb 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -13,7 +13,7 @@ interface Array { find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; /** - * 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, From 2f9879c45ea3fc202e5e628a04d2c8086dbd1a0b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 13 Sep 2016 22:41:40 -0700 Subject: [PATCH 2/2] Update other defintions of findIndex --- src/lib/es2015.core.d.ts | 6 +++--- src/lib/es5.d.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index e22dc3984fa..7550a02b15e 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -16,7 +16,7 @@ interface Array { * 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, + * order, until it finds one where predicate returns true. If such an element is found, * findIndex immediately returns that element index. Otherwise, findIndex 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. @@ -360,10 +360,10 @@ interface ReadonlyArray { find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; /** - * 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, + * order, until it finds one where predicate returns true. If such an element is found, * findIndex immediately returns that element index. Otherwise, findIndex 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. diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 59053aaa540..90f3a31a77c 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1537,7 +1537,7 @@ interface Int8Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -1810,7 +1810,7 @@ interface Uint8Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -2084,7 +2084,7 @@ interface Uint8ClampedArray { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -2357,7 +2357,7 @@ interface Int16Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -2631,7 +2631,7 @@ interface Uint16Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -2904,7 +2904,7 @@ interface Int32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -3177,7 +3177,7 @@ interface Uint32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -3450,7 +3450,7 @@ interface Float32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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, @@ -3724,7 +3724,7 @@ interface Float64Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * 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,