Skip to content

Commit

Permalink
chore: add nullopt for no variants
Browse files Browse the repository at this point in the history
  • Loading branch information
jpudysz committed Dec 20, 2024
1 parent d32a535 commit fcf2354
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cxx/parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,9 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
jsi::Value rawVariants = thisObject.hasProperty(rt, helpers::STYLE_VARIANTS.c_str())
? thisObject.getProperty(rt, helpers::STYLE_VARIANTS.c_str())
: jsi::Value::undefined();

Variants fakeVariants{};

std::optional<Variants> variants = rawVariants.isUndefined()
? fakeVariants // todo pass real variants
? std::nullopt
: std::optional<Variants>(helpers::variantsToPairs(rt, rawVariants.asObject(rt)));

unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
Expand Down

0 comments on commit fcf2354

Please sign in to comment.