(
ctx: &mut ScriptContext<'_, API>,
name: &str,
z_index: i32,
)
| 4018 | if !doc.scene.key_names.iter().any(|item| item.as_ref() == name) { |
| 4019 | return name; |
| 4020 | } |
| 4021 | } |
| 4022 | format!("{prefix}_x") |
| 4023 | } |
| 4024 | |
| 4025 | pub fn sanitize_node_name(text: &str) -> String { |
| 4026 | let mut out = String::new(); |
| 4027 | for ch in text.trim().chars() { |
| 4028 | if ch.is_ascii_alphanumeric() || ch == '_' { |
| 4029 | out.push(ch); |
| 4030 | } else if ch.is_whitespace() || ch == '-' || ch == '.' { |
| 4031 | out.push('_'); |
| 4032 | } |
| 4033 | } |
no test coverage detected