-
Notifications
You must be signed in to change notification settings - Fork 4
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
Attach moment to ajv instance? #1
Comments
@epoberezkin love the idea, but the issue I struggled with was the need to have moment available at validation time as opposed to compile time. As far as I can tell, there would be no way to access the ajv instance itself at validation time using the inline method, or am I missing something? |
Right, I was thinking about compilation time, where it's |
did not know about that, thanks for the sharing |
you're welcome. I think I may define some instance property where users can put their stuff to be certain it won't clash with any ajv stuff (like |
It may be a nicer solution than passing via context - from version 4.6.0 all custom keywords (but "validate") receive the third parameter - schema compilation context that has reference to ajv instance
it.self
. In this way if the moment is attached to the instance, you can access it from custom keywords.Or you could make moment a dependency of this package (there are pros and cons of course...)
The text was updated successfully, but these errors were encountered: