@azure/functions
Version:
Microsoft Azure Functions NodeJS Framework
25 lines (19 loc) • 815 B
text/typescript
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.
import * as types from '@azure/functions';
import { nonNullProp } from '../utils/nonNull';
import { InvocationHookContext } from './InvocationHookContext';
export class PreInvocationContext extends InvocationHookContext implements types.PreInvocationContext {
#init: types.PreInvocationContextInit;
constructor(init?: types.PreInvocationContextInit) {
super(init);
this.#init = init ?? {};
this.#init.functionCallback ??= () => {};
}
get functionHandler(): types.FunctionHandler {
return nonNullProp(this.#init, 'functionCallback');
}
set functionHandler(value: types.FunctionHandler) {
this.#init.functionCallback = value;
}
}