Home / Function/ toCamelCase() — drizzle-orm Function Reference

toCamelCase() — drizzle-orm Function Reference

Architecture documentation for the toCamelCase() function in casing.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  f2e06b54_c40c_e873_0b7b_dd1d9a267800["toCamelCase()"]
  f75147d3_9ada_e5d8_9b05_204b10aba05f["casing.ts"]
  f2e06b54_c40c_e873_0b7b_dd1d9a267800 -->|defined in| f75147d3_9ada_e5d8_9b05_204b10aba05f
  style f2e06b54_c40c_e873_0b7b_dd1d9a267800 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/casing.ts lines 14–23

export function toCamelCase(input: string) {
	const words = input
		.replace(/['\u2019]/g, '')
		.match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];

	return words.reduce((acc, word, i) => {
		const formattedWord = i === 0 ? word.toLowerCase() : `${word[0]!.toUpperCase()}${word.slice(1)}`;
		return acc + formattedWord;
	}, '');
}

Domain

Subdomains

Frequently Asked Questions

What does toCamelCase() do?
toCamelCase() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/casing.ts.
Where is toCamelCase() defined?
toCamelCase() is defined in drizzle-orm/src/casing.ts at line 14.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free