Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Fix(utils): exclude Date from isPlainObject
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jan 12, 2021
1 parent 649c03d commit 68ccf7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tame-books-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-cool-form": patch
---

Fix(utils): exclude `Date` from `isPlainObject`
2 changes: 1 addition & 1 deletion src/utils/isPlainObject.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isObject from "./isObject";

export default (value: unknown): value is Object =>
!Array.isArray(value) && isObject(value);
!Array.isArray(value) && !(value instanceof Date) && isObject(value);

0 comments on commit 68ccf7f

Please sign in to comment.