@typed/lambda
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -9,4 +9,4 @@ import { Apply, Fn } from './types'; | ||
<Args extends any[], T extends Fn<any[], any>>(args: Args, fn: T): Apply<Args, T>; | ||
<Args extends any[]>(args: Args): <T extends Fn<Args, any>>(fn: T) => Apply<Args, T>; | ||
<Args_1 extends any[]>(args: Args_1): <T_1 extends Fn<Args_1, any>>(fn: T_1) => Apply<Args_1, T_1>; | ||
}; | ||
//# sourceMappingURL=apply.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ArgsOf, Fn } from './types'; | ||
import { Fn } from './types'; | ||
/** | ||
@@ -6,3 +6,3 @@ * Memoize a function | ||
*/ | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => (...args: ArgsOf<F>) => ReturnType<F>; | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => F; | ||
//# sourceMappingURL=memoize.d.ts.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
const cache = new Map(); | ||
return (...args) => { | ||
return ((...args) => { | ||
const key = args.reduce((x, y) => x + common_1.toString(y), ''); | ||
@@ -22,4 +22,4 @@ if (cache.has(key)) { | ||
return result; | ||
}; | ||
}); | ||
}; | ||
//# sourceMappingURL=memoize.js.map |
@@ -10,4 +10,4 @@ import { Arity1, Fn } from './types'; | ||
<A, Args extends any[]>(withFn: Arity1<A, any>, fn: Fn<Args, A>): Fn<Args, A>; | ||
<A>(withFn: Arity1<A, any>): <Args extends any[]>(fn: Fn<Args, A>) => Fn<Args, A>; | ||
<A_1>(withFn: Arity1<A_1, any>): <Args_1 extends any[]>(fn: Fn<Args_1, A_1>) => Fn<Args_1, A_1>; | ||
}; | ||
//# sourceMappingURL=withPrevious.d.ts.map |
@@ -9,4 +9,4 @@ import { Apply, Fn } from './types'; | ||
<Args extends any[], T extends Fn<any[], any>>(args: Args, fn: T): Apply<Args, T>; | ||
<Args extends any[]>(args: Args): <T extends Fn<Args, any>>(fn: T) => Apply<Args, T>; | ||
<Args_1 extends any[]>(args: Args_1): <T_1 extends Fn<Args_1, any>>(fn: T_1) => Apply<Args_1, T_1>; | ||
}; | ||
//# sourceMappingURL=apply.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ArgsOf, Fn } from './types'; | ||
import { Fn } from './types'; | ||
/** | ||
@@ -6,3 +6,3 @@ * Memoize a function | ||
*/ | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => (...args: ArgsOf<F>) => ReturnType<F>; | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => F; | ||
//# sourceMappingURL=memoize.d.ts.map |
@@ -8,3 +8,3 @@ import { toString } from '@typed/common'; | ||
const cache = new Map(); | ||
return (...args) => { | ||
return ((...args) => { | ||
const key = args.reduce((x, y) => x + toString(y), ''); | ||
@@ -20,4 +20,4 @@ if (cache.has(key)) { | ||
return result; | ||
}; | ||
}); | ||
}; | ||
//# sourceMappingURL=memoize.js.map |
@@ -10,4 +10,4 @@ import { Arity1, Fn } from './types'; | ||
<A, Args extends any[]>(withFn: Arity1<A, any>, fn: Fn<Args, A>): Fn<Args, A>; | ||
<A>(withFn: Arity1<A, any>): <Args extends any[]>(fn: Fn<Args, A>) => Fn<Args, A>; | ||
<A_1>(withFn: Arity1<A_1, any>): <Args_1 extends any[]>(fn: Fn<Args_1, A_1>) => Fn<Args_1, A_1>; | ||
}; | ||
//# sourceMappingURL=withPrevious.d.ts.map |
{ | ||
"name": "@typed/lambda", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Helpful functions for working in a functional style", | ||
@@ -38,4 +38,4 @@ "main": "./cjs/index.js", | ||
"sideEffects": false, | ||
"gitHead": "4707f131e18502c2983f9ca66b74b0e9da48fc6d", | ||
"gitHead": "1182d7f246d79718d84a58f75a2d9e7e129875b8", | ||
"unpkg": "./umd/index.js" | ||
} |
@@ -8,6 +8,6 @@ import { toString } from '@typed/common' | ||
*/ | ||
export const memoize = <F extends Fn>(f: F) => { | ||
export const memoize = <F extends Fn>(f: F): F => { | ||
const cache = new Map<any, any>() | ||
return (...args: ArgsOf<F>): ReturnType<F> => { | ||
return ((...args: ArgsOf<F>): ReturnType<F> => { | ||
const key = args.reduce((x, y) => x + toString(y), '') | ||
@@ -28,3 +28,3 @@ | ||
return result | ||
} | ||
}) as F | ||
} |
@@ -9,4 +9,4 @@ import { Apply, Fn } from './types'; | ||
<Args extends any[], T extends Fn<any[], any>>(args: Args, fn: T): Apply<Args, T>; | ||
<Args extends any[]>(args: Args): <T extends Fn<Args, any>>(fn: T) => Apply<Args, T>; | ||
<Args_1 extends any[]>(args: Args_1): <T_1 extends Fn<Args_1, any>>(fn: T_1) => Apply<Args_1, T_1>; | ||
}; | ||
//# sourceMappingURL=apply.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ArgsOf, Fn } from './types'; | ||
import { Fn } from './types'; | ||
/** | ||
@@ -6,3 +6,3 @@ * Memoize a function | ||
*/ | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => (...args: ArgsOf<F>) => ReturnType<F>; | ||
export declare const memoize: <F extends Fn<any[], any>>(f: F) => F; | ||
//# sourceMappingURL=memoize.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
314813
163
1322