extend
extend<
D,O>(defaults,options):D&O
Defined in: core/utils/object.ts:20
Merges two objects into a new one. Values in options win over defaults.
Only own, enumerable properties are copied, and the merge is shallow. Neither argument is modified.
Type Parameters
Section titled “Type Parameters”D extends object
Shape of the defaults.
O extends object
Shape of the options.
Parameters
Section titled “Parameters”defaults
Section titled “defaults”D
Default settings.
options
Section titled “options”O
Settings that override the defaults.
Returns
Section titled “Returns”D & O
A new object with the properties of both.
Throws
Section titled “Throws”If either argument is not an object.
Example
Section titled “Example”extend({ width: 700, align: 'center' }, { width: 400 });// { width: 400, align: 'center' }