Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
fix(Sparky): correct target type of SparkyContext (resolve #1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatcuk authored and nchanged committed Jan 22, 2019
1 parent 4ee707f commit 5f31611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sparky/SparkyContext.ts
Expand Up @@ -13,14 +13,14 @@ export function getSparkyContext() {
return SparkyCurrentContext;
}

export function SparkyContext(target: () => { [key: string]: any } | (new () => any) | { [key: string]: any }) {
export function SparkyContext(target: { [key: string]: any } | (new () => any) | (() => { [key: string]: any })) {
if (utils.isPlainObject(target)) {
SparkyCurrentContext = target;
} else if (isClass(target)) {
const Class: any = target;
SparkyCurrentContext = new Class();
} else if (utils.isFunction(target)) {
SparkyCurrentContext = target();
SparkyCurrentContext = (<Function>target)();
}
return new SparkyContextClass(SparkyCurrentContext);
}

0 comments on commit 5f31611

Please sign in to comment.