Typescript 4.2 fixed a return type for objects without a prototype. This change throws an InvalidValueError for these, rather than the TypeError that was previously thrown.