to_camel_case (Function)¶
The to_camel_case function converts text to camelCase format, where the first word starts with a lowercase letter and subsequent words start with uppercase letters, with no separators between words. It intelligently handles various input formats for seamless conversion.
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
Note
This provider is currently in POC (proof-of-concept) status and under active development. Features and APIs may change without notice. Not intended for production infrastructure.
Camel case is the standard naming convention in JavaScript, Java, and many other programming languages. The function's smart word detection ensures proper capitalization regardless of whether the input is snake_case, kebab-case, or space-separated text.
Capabilities¶
This function enables you to:
- JavaScript identifiers: Convert text to valid JavaScript variable names
- API field names: Standardize JSON field names in camelCase format
- Configuration keys: Normalize configuration to camelCase for JavaScript/JSON
- Code generation: Generate camelCase identifiers programmatically
- Data transformation: Convert between naming conventions
Example Usage¶
locals {
example_result = upper(
# Function arguments here
)
}
output "function_result" {
description = "Result of upper function"
value = local.example_result
}
Signature¶
to_camel_case(input)
Arguments¶
Return Value¶
Returns a new string in camelCase format:
- First word starts with lowercase letter
- Subsequent words start with uppercase letter
- No separators between words
- Returns null if the input is null
Common Patterns¶
API Field Mapping¶
locals {
database_fields = ["user_id", "email_address", "created_at"]
api_fields = [
for field in local.database_fields :
provider::pyvider::to_camel_case(field)
]
# Result: ["userId", "emailAddress", "createdAt"]
}
JavaScript Configuration¶
variable "config_keys" {
default = ["max retry count", "timeout seconds", "enable logging"]
}
locals {
js_config = {
for key in var.config_keys :
provider::pyvider::to_camel_case(key) => "value"
}
}
Documentation version: 0.0.19 | Last updated: 2025-11-09