We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 672e344 commit a4a8372Copy full SHA for a4a8372
src/context.ts
@@ -1,5 +1,8 @@
1
import * as assert from 'assert';
2
-
+interface ContextData {
3
+ models: Object;
4
+ user: Object;
5
+};
6
export const createExpressContext = (data, res) => {
7
data = data || {};
8
data.user = data.user || null;
@@ -16,7 +19,7 @@ export const createExpressContext = (data, res) => {
16
19
export class Context {
17
20
models: Object;
18
21
user: Object;
- constructor (data) {
22
+ constructor (data: ContextData) {
23
Object.keys(data).forEach(key => {
24
this[key] = data[key]
25
});
0 commit comments