MCPcopy Create free account
hub / github.com/Effect-TS/effect / snakeToCamel

Function snakeToCamel

packages/effect/src/String.ts:1036–1043  ·  view source on GitHub ↗
(self: string)

Source from the content-addressed store, hash-verified

1034 * @since 2.0.0
1035 */
1036export const snakeToCamel = (self: string): string => {
1037 if (self.length === 0) return self
1038 let str = self[0]
1039 for (let i = 1; i < self.length; i++) {
1040 str += self[i] === "_" ? self[++i].toUpperCase() : self[i]
1041 }
1042 return str
1043}
1044
1045/**
1046 * Converts a snake_case string to PascalCase.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected