-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version 2.x converts regular expressions to objects when cloning #41
Comments
This is the problem. It incorrectly assumes that anything with with typeof object that is not an array is a plain object. export function isPlainObject(input: any): input is Object {
return input && typeof input === 'object' && !Array.isArray(input)
} The code previously had a custom function to determine the type. function typeOf(input) {
return ({}).toString.call(input).slice(8, -1).toLowerCase();
} |
@cressie176 @yeikos care to weigh in? |
This bug recently bit me and required more than a day of sleuthing before I figured it out. Hard to believe it is still an open issue more than 18 months after getting reported, especially since @cressie176 pointed out where the problem lies. |
Closed via e9bea18. |
Thanks for sharing merge. When upgrading from v1 to v2 I found the following bug. Bit confused as what could have caused it as the clone code doesn't seem to have changed greatly (other than being converted to TypeScript)
v1.x
v2.x
The text was updated successfully, but these errors were encountered: