tsync
tsync copied to clipboard
Wrong value is exported if hex number is used
#[derive(Serialize_repr)]
#[repr(u16)]
#[tsync]
pub enum KeyCode {
Space = 0x0020,
Apostrophe = 0x0027,
Comma = 0x002c,
Minus = 0x002d,
}
exports as
KeyCode = {
Space: 0,
Apostrophe: 1,
Comma: 2,
Minus: 3
}
the relevant code snippet for this issue seems to be:
https://github.com/Wulf/tsync/blob/08e14c04e439ecd1863526b11dc7b8c8d22d9a52/src/to_typescript/enums.rs#L142-L158
It is specifically because String::parse::