Skip to main content

Module naming

Module naming 

Source
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 f64 so integral values always include .0 (valid in C++, Kotlin, Swift, Dart, TS).
int_enum_variant_camel
Formats an integer enum discriminant as a camelCase variant identifier (neg1 / v0).
int_enum_variant_pascal
Formats an integer enum discriminant as a PascalCase variant 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 package headers aligned 1-to-1 with Gradle namespace and RN codegenConfig.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_CASE constant name into camelCase without allocating an intermediate lowercased String.
strip_on_prefix
Strips a leading on prefix 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) into PascalCase.
to_snake_case
Converts PascalCase, camelCase, kebab-case, or acronym-prefixed names (e.g. RCTModalHostView, testID, portrait-upside-down) into snake_case.
web_component_tag
Returns a valid Custom Element tag name prefixed with nv- (e.g. NvCounterCard -> nv-counter-card, CounterCard -> nv-counter-card).