Recursively converts an object or class/host instance with prototype getters into a plain object. Returns the original value if it is not an object or is nullish, or specialized types (Date, RegExp, Map, Set).
Optional
The object to convert
A new plain object with copied/evaluated properties
const copy = asObject({ a: 1 }); Copy
const copy = asObject({ a: 1 });
Recursively converts an object or class/host instance with prototype getters into a plain object. Returns the original value if it is not an object or is nullish, or specialized types (Date, RegExp, Map, Set).