Skip to content

Commit

Permalink
feat(types): add TPredicate
Browse files Browse the repository at this point in the history
closes #39
  • Loading branch information
oljekechoro authored and antongolub committed May 21, 2019
1 parent d17689f commit 7b09f8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/types/src/main/TPredicate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type TPredicate = (...args: any[]) => boolean
1 change: 1 addition & 0 deletions packages/types/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export { ICurrency } from './ICurrency'
export { IPromiseConstructor, IPromise } from './IPromise'
export { IStorage } from './IStorage'
export { IMoney } from './IMoney'
export { TPredicate } from './TPredicate'
4 changes: 4 additions & 0 deletions packages/types/src/test/TPredicate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { TPredicate } from './index';

const wrongPredicate: TPredicate = (a: number, b: number): number => a + b; // $ExpectError
const predicate: TPredicate = (a: number, b: number): boolean => a > b;

0 comments on commit 7b09f8b

Please sign in to comment.