Skip to main content

attribute_to_camel

Function attribute_to_camel 

Source
pub fn attribute_to_camel(name: &str) -> String
Expand description

Convert an HTML attribute name to its camelCase property name.

Checks the irregular attribute lookup table first, then falls back to generic kebab-case → camelCase conversion (removing - and capitalizing the following character).

§Examples

assert_eq!(attribute_to_camel("aria-describedby"), "ariaDescribedBy");
assert_eq!(attribute_to_camel("readonly"), "readOnly");
assert_eq!(attribute_to_camel("data-title"), "dataTitle");