@@ -136,7 +136,7 @@ const wrapHttpFunction = (execute: HttpFunction): RequestHandler => {
136136 * @return An Express hander function that invokes the user function
137137 */
138138const wrapCloudEventFunction = (
139- userFunction : CloudEventFunction
139+ userFunction : CloudEventFunction ,
140140) : RequestHandler => {
141141 const httpHandler = ( req : Request , res : Response ) => {
142142 const callback = getOnDoneCallback ( res ) ;
@@ -145,7 +145,7 @@ const wrapCloudEventFunction = (
145145 . then ( ( ) => userFunction ( cloudEvent ) )
146146 . then (
147147 result => callback ( null , result ) ,
148- err => callback ( err , undefined )
148+ err => callback ( err , undefined ) ,
149149 ) ;
150150 } ;
151151 return wrapHttpFunction ( httpHandler ) ;
@@ -157,7 +157,7 @@ const wrapCloudEventFunction = (
157157 * @return An Express hander function that invokes the user function
158158 */
159159const wrapCloudEventFunctionWithCallback = (
160- userFunction : CloudEventFunctionWithCallback
160+ userFunction : CloudEventFunctionWithCallback ,
161161) : RequestHandler => {
162162 const httpHandler = ( req : Request , res : Response ) => {
163163 const callback = getOnDoneCallback ( res ) ;
@@ -180,7 +180,7 @@ const wrapEventFunction = (userFunction: EventFunction): RequestHandler => {
180180 . then ( ( ) => userFunction ( data , context ) )
181181 . then (
182182 result => callback ( null , result ) ,
183- err => callback ( err , undefined )
183+ err => callback ( err , undefined ) ,
184184 ) ;
185185 } ;
186186 return wrapHttpFunction ( httpHandler ) ;
@@ -192,7 +192,7 @@ const wrapEventFunction = (userFunction: EventFunction): RequestHandler => {
192192 * @return An Express hander function that invokes the user function
193193 */
194194const wrapEventFunctionWithCallback = (
195- userFunction : EventFunctionWithCallback
195+ userFunction : EventFunctionWithCallback ,
196196) : RequestHandler => {
197197 const httpHandler = ( req : Request , res : Response ) => {
198198 const callback = getOnDoneCallback ( res ) ;
@@ -210,12 +210,12 @@ const wrapEventFunctionWithCallback = (
210210const wrapTypedFunction = ( typedFunction : TypedFunction ) : RequestHandler => {
211211 const typedHandlerWrapper : HttpFunction = async (
212212 req : Request ,
213- res : Response
213+ res : Response ,
214214 ) => {
215215 let reqTyped : unknown ;
216216 try {
217217 reqTyped = typedFunction . format . deserializeRequest (
218- new InvocationRequestImpl ( req )
218+ new InvocationRequestImpl ( req ) ,
219219 ) ;
220220 } catch ( err ) {
221221 sendCrashResponse ( {
@@ -234,7 +234,7 @@ const wrapTypedFunction = (typedFunction: TypedFunction): RequestHandler => {
234234 // eslint-disable-next-line @typescript-eslint/no-floating-promises
235235 typedFunction . format . serializeResponse (
236236 new InvocationResponseImpl ( res ) ,
237- resTyped
237+ resTyped ,
238238 ) ;
239239 } ;
240240
@@ -249,7 +249,7 @@ const wrapTypedFunction = (typedFunction: TypedFunction): RequestHandler => {
249249 */
250250export const wrapUserFunction = < T = unknown > (
251251 userFunction : HandlerFunction < T > ,
252- signatureType : SignatureType
252+ signatureType : SignatureType ,
253253) : RequestHandler => {
254254 switch ( signatureType ) {
255255 case 'http' :
@@ -258,15 +258,15 @@ export const wrapUserFunction = <T = unknown>(
258258 // Callback style if user function has more than 2 arguments.
259259 if ( userFunction instanceof Function && userFunction ! . length > 2 ) {
260260 return wrapEventFunctionWithCallback (
261- userFunction as EventFunctionWithCallback
261+ userFunction as EventFunctionWithCallback ,
262262 ) ;
263263 }
264264 return wrapEventFunction ( userFunction as EventFunction ) ;
265265 case 'cloudevent' :
266266 if ( userFunction instanceof Function && userFunction ! . length > 1 ) {
267267 // Callback style if user function has more than 1 argument.
268268 return wrapCloudEventFunctionWithCallback (
269- userFunction as CloudEventFunctionWithCallback
269+ userFunction as CloudEventFunctionWithCallback ,
270270 ) ;
271271 }
272272 return wrapCloudEventFunction ( userFunction as CloudEventFunction ) ;
0 commit comments