-
Notifications
You must be signed in to change notification settings - Fork 123
feat(op2): add #[validate(fn)]
for custom arg validation
#1137
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1137 +/- ##
==========================================
- Coverage 81.43% 80.75% -0.69%
==========================================
Files 97 100 +3
Lines 23877 28957 +5080
==========================================
+ Hits 19445 23385 +3940
- Misses 4432 5572 +1140 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Node.js APIs written in object wrap need to throw errors like
ERR_INVALID_ARG_TYPE
andERR_INVALID_CONSTRUCTOR
before argument de-serialization which is not directly exposed in op2. This is currently not possible.This PR adds custom validation hooks that run before de-serializing each argument using
#[validate(fn)]
attribute.