stylex_transform/transform/stylex/
transform_stylex_props_call.rs1use swc_core::{
2 common::comments::Comments,
3 ecma::ast::{CallExpr, Expr},
4};
5
6use crate::{
7 StyleXTransform,
8 shared::utils::{
9 core::{props::props, stylex_merge::stylex_merge},
10 validators::is_props_call,
11 },
12};
13
14impl<C> StyleXTransform<C>
15where
16 C: Comments,
17{
18 pub(crate) fn transform_stylex_props_call(&mut self, call: &mut CallExpr) -> Option<Expr> {
19 let is_props_call = is_props_call(call, &self.state);
20
21 if is_props_call {
22 return stylex_merge(call, props, &mut self.state);
23 }
24
25 None
26 }
27}