extendContext
extendContext(
context
,properties
,inheritanceTransformers?
):void
Defined in: core/src/core/context.ts:167
Use this function to add or extend properties of the root context.
Called by middleware’s createContext to update the root context.
Handler-scoped contexts will automatically inherit these properties from the root context.
Never create a new object (e.g., using a spread \{...context\}
) in your middleware’s createContext.
Parameters
Section titled “Parameters”context
Section titled “context”The context to extend
properties
Section titled “properties”Record
<string
, any
>
The properties to add to the context
inheritanceTransformers?
Section titled “inheritanceTransformers?”Record
<string
, InheritanceTransformer
>
The inheritance transformers to apply to existing properties (optional)
Returns
Section titled “Returns”void