-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix: make sure dates are correctly validated & parsed #639
fix: make sure dates are correctly validated & parsed #639
Conversation
fix: make sure transform-keys doesn't recurse into a Date object
Current coverage is 91.93% (diff: 100%)@@ master #639 diff @@
==========================================
Files 179 179
Lines 1982 1984 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1822 1824 +2
Misses 160 160
Partials 0 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just needs a test and one small change. Great work!
@@ -20,6 +20,7 @@ export function transformKeys<T: Object | Array<mixed>>( | |||
return entries(source).reduce((result, [key, value]) => { | |||
const recurse = deep | |||
&& value | |||
&& !(value instanceof Date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this line to after the typeof value === 'object'
check?
👏 |
fix: make sure dates are correctly validated
fix: make sure transform-keys doesn't recurse into a Date object
Proposed fix for #621