Skip to content

Commit

Permalink
Fixed a bug in isInteger helper which affect formist when you use a g…
Browse files Browse the repository at this point in the history
…uid inside a path like '8bbbef36adf64929bba8b656fa82f05a.name'
  • Loading branch information
iacoware committed Nov 26, 2020
1 parent 14fa006 commit 73a995c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.1.1 - 2020-11-26

- Fixed bug in `isInteger` helper function. The call `isInteger("8bbbef36adf64929bba8b656fa82f05a")` was returning true. Affect formist when you use a guid inside a path like '8bbbef36adf64929bba8b656fa82f05a.name'

## v1.1.0 - 2020-10-22

- Add `clear(defaultValues | null)` function which clear current values and errors
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const safeFn = (fn) => (...args) => (fn ? fn(...args) : undefined)

export const isInteger = (text) => !isNaN(parseInt(text, 10))
export const isInteger = (text) => !isNaN(parseInt(text, 10)) && isFinite(text)

export const isObject = (obj) =>
obj !== null && obj !== undefined && obj.constructor === Object
Expand Down

0 comments on commit 73a995c

Please sign in to comment.