Expand description
Identifier and case-conversion utilities for Rust, TypeScript, C++20, ObjC++, and Kotlin.
Functionsยง
- c_
field_ ident - Escapes reserved C11/C++20 keywords for snake_case C struct/vtable field names.
- cpp_
ident - Escapes reserved C++20 keywords.
- dart_
ident - Escapes reserved Dart keywords.
- escape_
c_ like_ string - Escapes a string literal for C11, C++20, ObjC++, Rust, and Swift double-quoted literals.
- escape_
dart_ single_ quoted_ string - Escapes a string literal for Dart single-quoted literals.
- escape_
kotlin_ string - Escapes a string literal for Kotlin double-quoted literals.
- escape_
ts_ single_ quoted - Escapes a string literal for TypeScript/JavaScript single-quoted literals.
- format_
float_ literal - Formats an
f64so integral values always include.0(valid in C++, Kotlin, Swift, Dart, TS). - int_
enum_ variant_ camel - Formats an integer enum discriminant as a
camelCasevariant identifier (neg1/v0). - int_
enum_ variant_ pascal - Formats an integer enum discriminant as a
PascalCasevariant identifier (Neg1/V0). - kotlin_
ident - Converts to camelCase and escapes reserved Kotlin keywords.
- kotlin_
package_ segment - Escapes a dotted Kotlin package segment without altering underscores or casing, keeping Kotlin
packageheaders aligned 1-to-1 with Gradlenamespaceand RNcodegenConfig.android.javaPackageName. - rust_
ident - Escapes reserved Rust keywords or leading-digit identifiers.
- sanitize_
block_ comment - Sanitizes untrusted text for inclusion in a block comment (
/* ... */or/** ... */). - sanitize_
single_ line_ comment - Sanitizes untrusted text for inclusion in a single-line (
//or///) comment. - screaming_
snake_ to_ camel_ case - Converts a
SCREAMING_SNAKE_CASEconstant name intocamelCasewithout allocating an intermediate lowercasedString. - strip_
on_ prefix - Strips a leading
onprefix from an event name if followed by an uppercase letter (e.g.onCountChange->countChange,onChange->change). - swift_
ident - Escapes reserved Swift keywords.
- to_
camel_ case - Converts an identifier into
camelCase. - to_
kebab_ case - Converts any identifier into
kebab-case(e.g.NvCounterCard->nv-counter-card). - to_
pascal_ case - Converts any identifier or hyphenated string literal (e.g.
'portrait-upside-down',on_count_change,small) intoPascalCase. - to_
snake_ case - Converts
PascalCase,camelCase,kebab-case, or acronym-prefixed names (e.g.RCTModalHostView,testID,portrait-upside-down) intosnake_case. - web_
component_ tag - Returns a valid Custom Element tag name prefixed with
nv-(e.g.NvCounterCard->nv-counter-card,CounterCard->nv-counter-card).