Skip to main content

create_ident_key_value_prop

Function create_ident_key_value_prop 

Source
pub fn create_ident_key_value_prop(key: &str, value: Expr) -> PropOrSpread
Expand description

Creates a PropOrSpread with an unconditional PropName::Ident key.

Unlike create_key_value_prop, this bypasses identifier validation, preserving keys that contain special characters (e.g. @media …) as ident nodes. Use this wherever downstream code calls .as_ident() on the resulting key.