Skip to main content

stylex_transform/transform/fold/
fold_prop_name.rs

1use swc_core::{
2  common::comments::Comments,
3  ecma::{ast::PropName, visit::FoldWith},
4};
5
6use crate::StyleXTransform;
7use stylex_enums::core::TransformationCycle;
8
9impl<C> StyleXTransform<C>
10where
11  C: Comments,
12{
13  pub(crate) fn fold_prop_name_impl(&mut self, prop_name: PropName) -> PropName {
14    match self.state.cycle {
15      TransformationCycle::Skip => prop_name,
16      TransformationCycle::StateFilling | TransformationCycle::Recounting
17        if prop_name.is_ident() =>
18      {
19        prop_name
20      },
21      _ => prop_name.fold_children_with(self),
22    }
23  }
24}