deepSet

Function

Deep set function. Like Ember.set, but smarter as it will create the path

  • deepSet(target: Record<stringany>, path: string, value: any, replace: boolean) : void

Parameters

Parameter Type Default Notes
target Required Record<stringany>

Object we want to set the property on

path Required string

Dotted path to the property we want to set

value Optional any {}

Value we want to assign to the property

replace Optional boolean false

If true, replace the value at the path with the new value instead of merging

Returns

void

Function defined in common/src/objects/deep-set.ts:10