Skip to content

Required validator has to accept numbers #28

Merged
merged 3 commits into from Dec 26, 2013

2 participants

@jpbochi
jpbochi commented Dec 24, 2013

And integer validator has to reject false

@luizfar luizfar commented on the diff Dec 24, 2013
src/validators/utilities.js
@@ -30,8 +30,12 @@ ko.validators.utilities = (function () {
return typeof value == 'string';
};
+ self.isNumber = function (num) {
@luizfar
luizfar added a note Dec 24, 2013

Maybe it's time - based on the last conversations we had - to add underscore or some other library that does these things for us?

@jpbochi
jpbochi added a note Dec 24, 2013

I think we need to talk with a bigger group of Reach developers. As I said earlier, I'd love to have that in Reach. There are some downsides, though.

Knockout itself does implement some helper functions instead of requiring an external library. Having ko-validation do this would be a Bad Thing ™️, because whatever library we require will have to be included in all its clients, including Reach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jpbochi
jpbochi commented Dec 26, 2013

@luizfar should we merge this and talk about including lodash later?

@luizfar
luizfar commented Dec 26, 2013

Go for it.

@jpbochi jpbochi merged commit ed016ac into master Dec 26, 2013

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.