Skip to content

Commit 5fa545d

Browse files
committed
fix(jsonView): simplify promise return
1 parent 7329c9b commit 5fa545d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/decorators.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ export function JsonView(params?: {}, method?: string): Function {
6666

6767
if (!!result && (typeof result === "object" || typeof result === "function") && typeof result.then === "function") {
6868
// If result is an instance of Promise.
69-
return result.then((data: any) => {
70-
return transformer(result, params);
71-
});
69+
return result.then((data: any) => transformer(result, params));
7270
}
7371

7472
result = transformer(result, params);

0 commit comments

Comments
 (0)