Interface CloneRule<T>

A CloneRule defines if and how an object should be cloned.

interface CloneRule<T> {
    clone: ((source: T, clone: CloneCallback) => DeepMutable<T>);
    matches: ((object: any) => object is T);
}

Type Parameters

  • T

Properties

Properties

clone: ((source: T, clone: CloneCallback) => DeepMutable<T>)

Clones the given value.

Type declaration

    • (source, clone): DeepMutable<T>
    • Parameters

      • source: T

        A value guaranteed to have matched with matches.

      • clone: CloneCallback

        This callback may be used to clone sub-properties.

      Returns DeepMutable<T>

matches: ((object: any) => object is T)

Returns true if this MergeRule should be applied for the given object.