The type of the value to be cloned
The value to make immutable
A deeply immutable clone of value
This function does not handle circular references and will cause infinite recursion leading to a stack overflow if the input contains cycles.
For functions with custom properties, built-in read-only properties (length, name, prototype)
are preserved unchanged while custom writable properties are frozen recursively.
Creates an immutable deep clone.
Plain objects, arrays, and functions with custom properties are recursively cloned and frozen. Functions without custom properties are returned as-is. Other object types (Date, RegExp, Buffer, etc.) are returned as-is to preserve their functionality.