Function validateClone

  • Clone a data with detailed type validation.

    Clones an instance following type T, with detailed type validation. If the target input value or its member variable contains a class instance having methods, those methods would not be cloned.

    In such reason, when input value is not matched with the type T, it returns IValidation.Failure value. Otherwise, there's no problem on the input value, cloned data would be stored in data property of the output IValidation.Success instance.

    Type Parameters

    • T

      Type of the input value

    Parameters

    • input: T

      A value to be cloned

    Returns IValidation<Resolved<T>>

    Validation result with cloned value

  • Clone a data with detailed type validation.

    Clones an instance following type T, with detailed type validation. If the target input value or its member variable contains a class instance having methods, those methods would not be cloned.

    In such reason, when input value is not matched with the type T, it returns IValidation.Failure value. Otherwise, there's no problem on the input value, cloned data would be stored in data property of the output IValidation.Success instance.

    Type Parameters

    • T

      Type of the input value

    Parameters

    • input: unknown

      A value to be cloned

    Returns IValidation<Resolved<T>>

    Validation result with cloned value