v8pp icon indicating copy to clipboard operation
v8pp copied to clipboard

Enhance Support for std::optional and Empty std::variant

Open MangelSpec opened this issue 1 year ago • 1 comments

This pull request introduces mapping for std::optional return types and parameters, providing a more seamless integration with TypeScript's optional parameters. The new mapping reflects the following TypeScript optional parameter syntax:

var: type | undefined
type? var

In addition, this commit extends std::variant support to include std::monostate, which is treated as an undefined value.

MangelSpec avatar Jun 04 '24 13:06 MangelSpec

Hi @MangelSpec

wow, thank you for adding this new featur, it looks really handy!

Maybe you have also a couple of use cases that may be added as test cases in test/test_convert.cpp?

I'm going to merge this PR right after fixing failing CI build, that isn’t green now on the master branch.

pmed avatar Jun 05 '24 04:06 pmed

Hi @MangelSpec, thank you for the contributing! I've added test for your changes and merged them in #231

pmed avatar Nov 19 '25 22:11 pmed