Function: mergeBlueprints()
Function: mergeBlueprints()
function mergeBlueprints<U, V>(...blueprints): StoneBlueprint<U, V>;
Merges multiple blueprints into a single application blueprint.
This function takes any number of blueprint objects and merges them into one, with later blueprints overwriting properties of earlier ones in case of conflicts. It uses deep merging to ensure nested properties are also combined appropriately. Note: The deepmerge
function can lead to unexpected results if objects have circular references. Consider handling such cases or documenting this behavior if it applies to your usage.
Type Parameters
U
U
extends IncomingEvent
= IncomingEvent
V
V
extends OutgoingResponse
= OutgoingResponse
Parameters
blueprints
...( | Record
<string
, any
> | StoneBlueprint
<U
, V
>)[]
An array of blueprints to be merged.
Returns
StoneBlueprint
<U
, V
>
The merged application blueprint.
Throws
- If any of the provided blueprints are not valid objects.
Example
const mergedBlueprint = mergeBlueprints(blueprint1, blueprint2);