From d9d12b0635c38852e3b0930da5849bd330247ce6 Mon Sep 17 00:00:00 2001 From: Tushar Mathur Date: Sat, 15 Oct 2016 22:19:23 +0530 Subject: [PATCH] refactor(curry): move interface to types folder --- src/lib/Curry.ts | 5 ++--- src/types/ICurryFunction.ts | 7 +++++++ test/test.Curry.ts | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/types/ICurryFunction.ts diff --git a/src/lib/Curry.ts b/src/lib/Curry.ts index 2ec575b..6946b66 100644 --- a/src/lib/Curry.ts +++ b/src/lib/Curry.ts @@ -2,9 +2,8 @@ * Created by tushar.mathur on 15/10/16. */ -export interface ICurryFunction { - (...k: any[]): T | ICurryFunction -} + +import {ICurryFunction} from '../types/ICurryFunction' export function Curry (f: ICurryFunction): ICurryFunction { return function curried (...t: any[]): T | ICurryFunction { diff --git a/src/types/ICurryFunction.ts b/src/types/ICurryFunction.ts new file mode 100644 index 0000000..6f7a66c --- /dev/null +++ b/src/types/ICurryFunction.ts @@ -0,0 +1,7 @@ +/** + * Created by tushar.mathur on 15/10/16. + */ + +export interface ICurryFunction { + (...k: any[]): T | ICurryFunction +} diff --git a/test/test.Curry.ts b/test/test.Curry.ts index 0879f2f..4ed65eb 100644 --- a/test/test.Curry.ts +++ b/test/test.Curry.ts @@ -3,7 +3,8 @@ */ import test from 'ava' -import {Curry, ICurryFunction} from '../src/lib/Curry' +import {Curry} from '../src/lib/Curry' +import {ICurryFunction} from '../src/types/ICurryFunction' const func = Curry( (a: number, b: number, c: number) => [a, b, c]