Skip to content

Commit

Permalink
Merge pull request #165 from ReactiveX/fix-typeguard-predicate-typings
Browse files Browse the repository at this point in the history
fix(typings): Fix optional predicate typings for user-defined typeguard predicates
  • Loading branch information
trxcllnt committed Nov 28, 2017
2 parents 868d16f + fedd563 commit a8a7fc9
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/add/asynciterable-operators/first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { first } from '../../asynciterable/first';

export function firstProto<T, S extends T>(
this: AsyncIterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export function firstProto<T>(
this: AsyncIterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/add/asynciterable-operators/last.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { last } from '../../asynciterable/last';

export function lastProto<T, S extends T>(
this: AsyncIterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export function lastProto<T>(
this: AsyncIterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/add/asynciterable-operators/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { single } from '../../asynciterable/single';

export function singleProto<T, S extends T>(
this: AsyncIterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export function singleProto<T>(
this: AsyncIterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/add/iterable-operators/first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { first } from '../../iterable/first';

export function firstProto<T, S extends T>(
this: IterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function firstProto<T>(
this: IterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/add/iterable-operators/last.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { last } from '../../iterable/last';
*/
export function lastProto<T, S extends T>(
this: IterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function lastProto<T>(
this: IterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/add/iterable-operators/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { single } from '../../iterable/single';
*/
export function singleProto<T, S extends T>(
this: IterableX<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function singleProto<T>(
this: IterableX<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/asynciterable/first.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export async function first<T, S extends T>(
source: AsyncIterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export async function first<T>(
source: AsyncIterable<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/asynciterable/last.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export async function last<T, S extends T>(
source: AsyncIterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export async function last<T>(
source: AsyncIterable<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/asynciterable/single.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export async function single<T, S extends T>(
source: AsyncIterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): Promise<S | undefined>;
export async function single<T>(
source: AsyncIterable<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/iterable/first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
export function first<T, S extends T>(
source: Iterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function first<T>(
source: Iterable<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/iterable/last.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function last<T, S extends T>(
source: Iterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function last<T>(
source: Iterable<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/iterable/single.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function single<T, S extends T>(
source: Iterable<T>,
predicate?: (value: T, index: number) => value is S
predicate: (value: T, index: number) => value is S
): S | undefined;
export function single<T>(
source: Iterable<T>,
Expand Down

0 comments on commit a8a7fc9

Please sign in to comment.