Skip to content

Instantly share code, notes, and snippets.

@sallar sallar/ts-curry.ts
Created Nov 20, 2017

What would you like to do?
Typescript Module Curry
module Cart {
export function test1() {
export function test2() { }
function curryModule<T>(mod: T): T {
return Object
.map(method => ({ method, fn: mod[method] }))
.reduce((all: T, curr) => {
all[curr.method] = curr.fn;
return all;
}, {} as T);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.