oxc/crates/oxc_regular_expression/src/surrogate_pair.rs
overlookmotel e7bd49dae4 refactor(regular_expression): correct typo (#5429)
Just correct a misspelling.
2024-09-04 00:54:22 +00:00

11 lines
286 B
Rust

pub fn is_lead_surrogate(cp: u32) -> bool {
(0xd800..=0xdbff).contains(&cp)
}
pub fn is_trail_surrogate(cp: u32) -> bool {
(0xdc00..=0xdfff).contains(&cp)
}
pub fn combine_surrogate_pair(lead: u32, trail: u32) -> u32 {
(lead - 0xd800) * 0x400 + trail - 0xdc00 + 0x10000
}