-
Notifications
You must be signed in to change notification settings - Fork 1
Improve extract args #198
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
Improve extract args #198
Conversation
| T napi_extract_value(napi_env env, napi_value value); | ||
|
|
||
| template<> | ||
| inline std::wstring napi_extract_value<std::wstring>(napi_env env, napi_value value) { |
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.
This is the function we use to extract a string argument.
| } | ||
|
|
||
| template<> | ||
| inline int64_t napi_extract_value<int64_t>(napi_env env, napi_value value) { |
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.
This is the function we use to extract a int64 argument
| template<size_t N> | ||
| std::array<std::wstring, N> napi_extract_args(napi_env env, napi_callback_info info) { | ||
| template<> | ||
| inline bool napi_extract_value<bool>(napi_env env, napi_value value) { |
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.
This is the function we use to extract a boolean argument
| return result; | ||
| } | ||
|
|
||
| template<typename... Types, std::size_t... Is> |
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.
These two functions are parsed in compilation to extract all arguments based on the types we pass
|
Hey @dajimenezriv-internxt, no reviewers are assigned to this PR. That will not trigger any notification and therefore, no one will be noticed about the need to review |
|




No description provided.