Comparing version 0.0.4 to 0.0.5
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"scripts": { | ||
@@ -19,0 +19,0 @@ "lint": "tslint --project ./tsconfig.json", |
@@ -1,3 +0,1 @@ | ||
declare type AnyFunction = (...params: any[]) => any; | ||
declare type UnknownFunction = (...params: unknown[]) => unknown; | ||
export declare function pipe<A extends unknown[], B>(ab: (...a: A) => B): (...args: A) => B; | ||
@@ -12,3 +10,2 @@ export declare function pipe<A extends unknown[], B, C>(ab: (...a: A) => B, bc: (b: B) => C): (...args: A) => C; | ||
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I, J>(ab: (...a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J): (...args: A) => J; | ||
export declare function pipe(...fns: AnyFunction[]): UnknownFunction; | ||
export declare function pipeWith<A, B>(a: A, ab: (a: A) => B): B; | ||
@@ -23,3 +20,1 @@ export declare function pipeWith<A, B, C>(a: A, ab: (a: A) => B, bc: (b: B) => C): C; | ||
export declare function pipeWith<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J): J; | ||
export declare function pipeWith(a: unknown, ...fns: AnyFunction[]): unknown; | ||
export {}; |
@@ -18,2 +18,5 @@ "use strict"; | ||
describe('pipe', function () { | ||
it('works when first function has 0 params', function () { | ||
assert.strictEqual(index_1.pipe(function () { return 1; }, singleParamFnAdd1)(), 2); | ||
}); | ||
it('works when first function has single param', function () { | ||
@@ -30,3 +33,2 @@ // One test for each overload | ||
assert.strictEqual(index_1.pipe(singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1)(1), 47); | ||
assert.strictEqual(index_1.pipe(singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2)(1), 94); | ||
}); | ||
@@ -49,5 +51,4 @@ it('works when first function has multiple params', function () { | ||
assert.strictEqual(index_1.pipeWith(1, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1), 47); | ||
assert.strictEqual(index_1.pipeWith(1, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1, singleParamFnTimes2), 94); | ||
}); | ||
}); | ||
//# sourceMappingURL=tests.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14127
96