core.add
Home > @medplum/core > add
add() function
o If the target location specifies an array index, a new value is inserted into the array at the specified index. o If the target location specifies an object member that does not already exist, a new member is added to the object. o If the target location specifies an object member that does exist, that member's value is replaced.
Signature:
export declare function add(object: any, operation: AddOperation, options?: PatchOptions): MissingError | null;
Parameters
Parameter | Type | Description |
|---|---|---|
object | any | The object being patched. |
operation | The operation to perform on the object. | |
options | (Optional) Optional params. |
Returns:
MissingError | null
null on success, or error if one occurred.