Merges the given inputs together using the default configuration.
Merges the array of inputs together using the default configuration.
Note: If inputs
isn't typed as a tuple then we cannot determine the output type. The output type will simply be
unknown
.
Mutate the target by merging the other inputs into it using the default configuration.
Generate a customized deepmerge
function using the given options. The returned function works just like deepmerge
except it uses the customized configuration.
The following options can be used to customize the deepmerge function.
All these options are optional.
Type: false | (values: Record<any, unknown>[], utils: DeepMergeUtils, meta: MetaData) => unknown
If false
, records won't be merged. If set to a function, that function will be used to merge records.
Note: Records are "vanilla" objects (e.g. { foo: "hello", bar: "world" }
).
Type: false | (values: unknown[][], utils: DeepMergeUtils, meta: MetaData) => unknown
If false
, arrays won't be merged. If set to a function, that function will be used to merge arrays.
Type: false | (values: Map<unknown, unknown>[], utils: DeepMergeUtils, meta: MetaData) => unknown
If false
, maps won't be merged. If set to a function, that function will be used to merge maps.
Type: false | (values: Set<unknown>[], utils: DeepMergeUtils, meta: MetaData) => unknown
If false
, sets won't be merged. If set to a function, that function will be used to merge sets.
Type: (values: unknown[], utils: DeepMergeUtils, meta: MetaData) => unknown
If set to a function, that function will be used to merge everything else.
Note: This includes merging mixed types, such as merging a map with an array.
Type: false | (values: unknown[], meta: MetaData) => unknown[]
If false
, no values will be filter out. If set to a function, that function will be used to filter values.
By default, undefined
values will be filtered out (null
values will be kept).
Type: MetaData
The given meta data value will be passed to root level merges.
This is a set of utility functions that are made available to your custom merge functions.
These are all the merge function being used to perform the deepmerge.
These will be the custom merge functions you gave, or the default merge functions for options you didn't customize.
These are all the merge functions that the default, non-customized deepmerge
function uses.
This function is used to update the meta data. Call it with the new meta data when/where applicable.
This is your top level customized deepmerge
function.
Note: Be careful when calling this as it is really easy to end up in an infinite loop.
States whether or not implicit default merging is in use.
Contains symbols that can be used to tell deepmerge-ts
to perform a special action.
Generate a customized deepmergeInto
function using the given options. The returned function works just like
deepmergeInto
except it uses the customized configuration.
The following options can be used to customize the deepmerge function.
All these options are optional.
Type: false | (target: DeepMergeValueReference<Record<PropertyKey, unknown>>, values: Record<any, unknown>[], utils: DeepMergeUtils, meta: MetaData) => void | symbol
If false
, records won't be merged. If set to a function, that function will be used to merge records by mutating
target.value
.
Note: Records are "vanilla" objects (e.g. { foo: "hello", bar: "world" }
).
Type: false | (target: DeepMergeValueReference<unknown[]>, values: unknown[][], utils: DeepMergeIntoFunctionUtils, meta: MetaData) => void | symbol
If false
, arrays won't be merged. If set to a function, that function will be used to merge arrays by mutating
target.value
.
Type: false | (target: DeepMergeValueReference<Map<unknown, unknown>>, values: Map<unknown, unknown>[], utils: DeepMergeIntoFunctionUtils, meta: MetaData) => void | symbol
If false
, maps won't be merged. If set to a function, that function will be used to merge maps by mutating
target.value
.
Type: false | (target: DeepMergeValueReference<Set<unknown>>, values: Set<unknown>[], utils: DeepMergeIntoFunctionUtils, meta: MetaData) => void | symbol
If false
, sets won't be merged. If set to a function, that function will be used to merge sets by mutating
target.value
.
Type: (target: DeepMergeValueReference<unknown>, values: unknown[], utils: DeepMergeIntoFunctionUtils, meta: MetaData) => void | symbol
If set to a function, that function will be used to merge everything else by mutating target.value
.
Note: This includes merging mixed types, such as merging a map with an array.
Type: false | (values: unknown[], meta: MetaData) => unknown[]
If false
, no values will be filter out. If set to a function, that function will be used to filter values.
By default, undefined
values will be filtered out (null
values will be kept).
Type: MetaData
The given meta data value will be passed to root level merges.
This is a set of utility functions that are made available to your custom merge functions.
These are all the merge function being used to perform the deepmerge.
These will be the custom merge functions you gave, or the default merge functions for options you didn't customize.
These are all the merge functions that the default, non-customized deepmerge
function uses.
This function is used to update the meta data. Call it with the new meta data when/where applicable.
This is your top level customized deepmergeInto
function.
Note: Be careful when calling this as it is really easy to end up in an infinite loop.
Contains symbols that can be used to tell deepmerge-ts
to perform a special action.