Skip to content

Overview / deepDefaults

deepDefaults()

deepDefaults<T>(target, ...sources): T

Merges the properties of the source objects into the target object, recursively applying defaults.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
targetTThe target object to apply defaults to.
...sourcesany[]The source objects containing default values.

Returns

T

A new object with the merged properties.

Released under the GPL-3.0 License.