From fcf2354fd7dca36a8f265e376b71d2b852dcb335 Mon Sep 17 00:00:00 2001 From: Jacek Pudysz Date: Fri, 20 Dec 2024 14:24:49 +0100 Subject: [PATCH] chore: add nullopt for no variants --- cxx/parser/Parser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cxx/parser/Parser.cpp b/cxx/parser/Parser.cpp index 6492458d..3933cbf8 100644 --- a/cxx/parser/Parser.cpp +++ b/cxx/parser/Parser.cpp @@ -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 = rawVariants.isUndefined() - ? fakeVariants // todo pass real variants + ? std::nullopt : std::optional(helpers::variantsToPairs(rt, rawVariants.asObject(rt))); unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);