Skip to content

Commit c0c144f

Browse files
Salakarlaurenzlong
authored andcommitted
fix(wrap): Extensions functions.handler -> eventType key exists but is undefined value (#49)
1 parent a25faf5 commit c0c144f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- '6.14.0'
43
- '8'
4+
- '10'
55
- stable
66
sudo: false

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
"lodash": "^4.17.5"
3535
},
3636
"devDependencies": {
37-
"@types/chai": "^4.1.2",
38-
"@types/mocha": "^5.0.0",
39-
"chai": "^4.1.2",
40-
"firebase-admin": "~6.1.0",
41-
"firebase-functions": "^2.1.0",
42-
"mocha": "^5.0.5",
43-
"sinon": "^4.4.9",
44-
"tslint": "^5.8.0",
45-
"typescript": "^2.4.1"
37+
"@types/chai": "~4.2.4",
38+
"@types/mocha": "^5.2.7",
39+
"chai": "^4.2.0",
40+
"firebase-admin": "~8.6.1",
41+
"firebase-functions": "^3.3.0",
42+
"mocha": "^6.2.2",
43+
"sinon": "^7.5.0",
44+
"tslint": "^5.20.0",
45+
"typescript": "^3.6.4"
4646
},
4747
"peerDependencies": {
4848
"firebase-functions": ">1.0.1",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function wrap<T>(cloudFunction: CloudFunction<T>): WrappedFunction {
111111
params: {},
112112
};
113113

114-
if (has(defaultContext, 'eventType') &&
114+
if (has(defaultContext, 'eventType') && defaultContext.eventType !== undefined &&
115115
defaultContext.eventType.match(/firebase.database/)) {
116116
defaultContext.authType = 'UNAUTHENTICATED';
117117
defaultContext.auth = null;

0 commit comments

Comments
 (0)