Skip to main content

core.deepclone

Home > @medplum/core > deepClone

deepClone() function

Creates a deep clone of the input value.

Limitations: - Only supports JSON primitives and arrays. - Does not support Functions, lambdas, etc. - Does not support circular references.

See: https://web.dev/structured-clone/ See: https://stackoverflow.com/questions/40488190/how-is-structured-clone-algorithm-different-from-deep-copy

Signature:

export declare function deepClone<T>(input: T): T;

Parameters

ParameterTypeDescription
inputTThe input to clone.

Returns:

T

A deep clone of the input.