Closed DmitryAstafyev closed 9 months ago
@sehz please take a look: https://github.com/infinyon/node-bindgen/pull/280
@sehz somehow tests on mac are failed... all of them... even linux is green. It doesn't look like it related to suggested changes... Could you please join also and help with tests?
it probably that it is using old nodejs version. @morenol can you update that test?
It looks like it is happening on main
too, because this PR is also failing https://github.com/infinyon/node-bindgen/pull/281
@sehz @morenol PR is green... looks like you fixed macos )
I guess it can be closed as well.
Issue
Looks like supporting of option type (
Option<T>
) isn't fully implemented.Rust code
On JS side I'm expecting to do as well:
For example from
serde_json
perspectiveOption::None
equal toundefined
andnull
as well. Parsing goes without issues and withundefined
and withnull
and without definition of value on js-object.Reproducing
I'm also attaching sources of working example.
Suggestion
Value
Option::None
should have an equivalent on JS side -null
andundefined
as well. "From" rust world to JS worldOption::None
should be returned asnull
. Well in general my suggestion just to fitserde_json
node-bindgen_issue_options.zip
Many thanks in advance for your feedback.