Add a arity predicate for functions#787
Conversation
There was a problem hiding this comment.
noted:
I copy pasted from number.min,
migt be then interesting to go over all the api.md to replace all the var.
(in a dedicated PR of course)
There was a problem hiding this comment.
there is no const so far in the doc.
then should be changed all at once. :)
|
Agreed on names. |
|
voilà :) |
test/function.js
Outdated
There was a problem hiding this comment.
You should check the error thrown in case it's not what you expect.
|
voilà :) went for |
|
That' fine, only missing arrow functions now. |
|
dooooh, forgot about them. haha. |
|
done :) |
test/function.js
Outdated
There was a problem hiding this comment.
Can you check the reason of the failure for those as well?
There was a problem hiding this comment.
for ['', false] you mean?
There was a problem hiding this comment.
The comment is on that line so yes :)
There was a problem hiding this comment.
haha, git diff is too broad, showing the whole hunk ^^
There was a problem hiding this comment.
(by the way, what does the null is a placeholder for?)
There was a problem hiding this comment.
Validation options -> https://github.com/hapijs/joi/blob/master/test/helper.js#L31
|
Mind to squash those commits ? |
Add a arity predicate for functions Apply style recommandations for func().arity() Add minArity and maxArity matchers to func() function arity -> Made test more secific about exception thrown Test also function arrity predicate on arrow functions Add test predicated for error message in function
5f657ca to
7d8ceb5
Compare
|
done |
Add a arity predicate for functions
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
add a predicate to enfore number args should take provided function.
This is fully functional, but predicate for min/max should be added to.
Waiting for some feedback for this implementation, (and suggestion for name. (so far thinking about
maxArity,minArity