Skip to main content

Module convertors

Module convertors 

Source

Functionsยง

concat_call_to_template_literal ๐Ÿ”’
Helper function that converts a CallExpr representing .concat() to a template literal.
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_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_wtf8_to_atom
create_big_int_expr
create_bool_expr
create_ident_expr
create_null_expr
create_number_expr
create_string_expr
expand_shorthand_prop
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
should_wrap_prop_name_key_with_quotes ๐Ÿ”’