A value to be cloned
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
Cloned data
Jeongho Nam - https://github.com/samchon
Clone a data with type assertion.
Clones an instance following type T
, with type assertion. 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 throws an
TypeGuardError or custom error generated by errorFactory. Otherwise,
there's no problem on the input
value, cloned data would be returned.
A value to be cloned
Optional
errorFactory: ((props: TypeGuardError.IProps) => Error)Custom error factory. Default is TypeGuardError
Cloned data
Jeongho Nam - https://github.com/samchon
Clone a data with type assertion.
Clones an instance following type
T
, with type assertion. If the targetinput
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 typeT
, it throws an TypeGuardError or custom error generated by errorFactory. Otherwise, there's no problem on theinput
value, cloned data would be returned.