Skip to content
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

Remove exception from isValid #440

Closed
leshakoss opened this issue Feb 16, 2017 · 1 comment
Closed

Remove exception from isValid #440

leshakoss opened this issue Feb 16, 2017 · 1 comment
Milestone

Comments

@leshakoss
Copy link
Contributor

See #389

@leshakoss leshakoss modified the milestone: v2.0.0 Feb 23, 2017
leshakoss added a commit that referenced this issue Apr 4, 2017
* Clean argument using `toDate` in `isValid`

* `isValid` changelog entry

* Regenerate typings
leshakoss added a commit that referenced this issue Apr 14, 2017
* Clean argument using `toDate` in `isValid`

* `isValid` changelog entry

* Regenerate typings
leshakoss added a commit that referenced this issue May 4, 2017
* Clean argument using `toDate` in `isValid`

* `isValid` changelog entry

* Regenerate typings
leshakoss added a commit that referenced this issue May 20, 2017
* Clean argument using `toDate` in `isValid`

* `isValid` changelog entry

* Regenerate typings
leshakoss added a commit that referenced this issue May 20, 2017
* Clean argument using `toDate` in `isValid`

* `isValid` changelog entry

* Regenerate typings
@Zashy
Copy link

Zashy commented Oct 17, 2017

Not checking the type is fine and all, but returning false makes a heck of a lot more sense than exploding with an exception. Shouldn't an isValid check tell you a string isn't a date, not throw an error?

isValid('puu') //=> explodes

// so to actually check if that's valid I guess we'd have to do something like...
let valid = false
try {
  valid = isValid('puu')
} catch () {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants