Bump deps, TS 3.5.1 (#962)

This commit is contained in:
Jaco Greeff
2019-05-29 22:32:25 +02:00
committed by GitHub
parent b6eb427a47
commit 55cb55aeb1
9 changed files with 154 additions and 150 deletions
+16 -7
View File
@@ -47,15 +47,24 @@ export interface Derive {
}
function injectFunctions (api: ApiInterface$Rx, derive: Derive, functions: DeriveCustom): Derive {
Object.keys(functions).forEach((sectionName: string) => {
const section = functions[sectionName as keyof Derive];
const result = derive[sectionName as keyof Derive] = derive[sectionName as keyof Derive] || {};
Object
.entries(functions)
.forEach(([sectionName, section]) => {
const sectionKey = sectionName as keyof Derive;
Object.keys(section).forEach((methodName) => {
// @ts-ignore No idea how to make this work...
result[methodName as keyof section] = section[methodName as keyof section](api);
if (!derive[sectionKey]) {
derive[sectionKey] = {} as any;
}
const result = derive[sectionKey];
Object
.entries(section)
.forEach(([methodName, method]) => {
// @ts-ignore No idea how to make this work...
result[methodName as keyof section] = method(api);
});
});
});
return derive;
}