Ensure type information is not lost.

When data containing complex types is resolved, some type information may be lost. Preserve that for types that are not basic record-like objects, such as Buffer, Date, and RegExp types.