samchon/typia

Internal function `$clone()` is wrong

Closed this issue · 0 comments

The $clone() function is used by typia.misc.clone<T>() function when some value has any type.

By the way, return type of typia.misc.clone<T>() is Resolved<T>, but $clone() function is returning Primitive<T> type.

Also, its function is just returning JSON level hard copying: JSON.parse(JSON.stringify(value)).

Therefore, the $clone() function's return type and main logic must be changed, suitable for its origin spec.