fix(transformer): always create valid identifiers (#2131)

I'm not familiar with the transformer, so not 100% sure what this
function does. But from the name `create_valid_identifier`, I'm guessing
that `-` is a mistake - it's not a valid character to have in
identifiers.

If I've misunderstood, please feel free to close this.
This commit is contained in:
overlookmotel 2024-01-23 04:35:41 +00:00 committed by GitHub
parent 71173a9181
commit 777352e2ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,7 +162,7 @@ fn create_valid_identifier(
// }
let id = Atom::from(
atom.chars().map(|c| if is_identifier_part(c) { c } else { '-' }).collect::<String>(),
atom.chars().map(|c| if is_identifier_part(c) { c } else { '_' }).collect::<String>(),
);
let id = if id == "" {