Skip to main content

Module convertors

Module convertors 

Source

Functionsยง

binary_expr_to_num
binary_expr_to_string
convert_atom_to_str_ref
Helper function to convert Atom to &str (reference, not owned String) Useful when you need a reference instead of an owned String
convert_atom_to_string
Helper function to convert Wtf8Atom to String Note: .as_str() returns an Option<&str> that only fails when the string contains invalid UTF-8
convert_concat_to_tpl_expr
Converts a string .concat() call expression to a template literal expression.
convert_expr_to_bool
convert_expr_to_str
convert_ident_to_expr
convert_key_value_to_str ๐Ÿ”’
convert_lit_to_number
Helper function to convert a Lit to a number
convert_lit_to_string
convert_simple_tpl_to_str_expr
Converts a simple template literal expression to a regular string literal expression. This is a convenience wrapper around convert_tpl_to_string_lit that works with Expr::Tpl.
convert_str_lit_to_atom
Helper function to safely get Atom from Lit::Str
convert_str_lit_to_string
Helper function to safely get string from Lit::Str
convert_string_to_prop_name
convert_tpl_to_string_lit
Helper function to convert a Tpl to a string literal
convert_unary_to_num
convert_wtf8_to_atom
create_big_int_expr
create_bool_expr
create_ident_expr
create_null_expr
create_number_expr
create_string_expr
evaluate_left_and_right_expression ๐Ÿ”’
expand_shorthand_prop
expr_to_num
expr_tpl_to_string
extract_str_lit_ref
Helper function to safely extract string from Lit::Str using Option pattern
extract_tpl_cooked_value
Helper function to safely get cooked string from TplElement
handle_tpl_to_expression
ident_to_number
ident_to_string ๐Ÿ”’
transform_bin_expr_to_number