Module utils

Source

Functions§

escape_chars
Escapes special characters in a given input string.
extract_blocks
Extract same level blocks positions.
filter_value
Recursively filter a Value with the function escape_chars
filter_value_keys
Recursively filters the keys (names) of a Value with the function escape_chars
find_tag_position
Finds the position of a tag in the text.
get_code_position
Finds the position of the first occurrence of BIF_CODE_B in the source string, but only when it is not inside any nested brackets.
get_from_key
Retrieves a value from a JSON schema using a specified key.
is_array_key
Checks if the value associated with a key in the schema is considered an array.
is_bool_key
Checks if the value associated with a key in the schema is considered a boolean true.
is_defined_key
Checks if the value associated with a key in the schema is considered defined.
is_empty_key
Checks if the value associated with a key in the schema is considered empty.
merge_schema
Merges two JSON schemas represented as serde_json::Value.
merge_schema_owned
Same as merge_schema but takes ownership of b to avoid clones. Use this when you don’t need b after the merge.
remove_comments
Removes comments from the template source.
resolve_pointer 🔒
Helper function to resolve a pointer-like key (e.g., “a->b->0”) in a JSON Value.
strip_prefix_suffix
Removes a prefix and suffix from a string slice.
unescape_chars
Unescapes HTML entities in a given input string.
update_schema
Merge schema and update some keys
update_schema_owned
Same as update_schema but takes ownership of b to avoid clones.
wildcard_match
Performs a wildcard matching between a text and a pattern.