MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / snakeToSentenceCase

Function snakeToSentenceCase

console/src/util.ts:170–177  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

168 * e.g. "some_example_string" returns a "Some example string".
169 */
170export function snakeToSentenceCase(input: string): string {
171 return input
172 .split("_")
173 .map((word, index) =>
174 index === 0 ? capitalizeSentence(word, false) : word.toLowerCase(),
175 )
176 .join(" ");
177}
178
179/** Constrains a given number to a min and max. */
180export function clamp(value: number, min: number, max: number) {

Callers 1

StatusEventToastFunction · 0.90

Calls 4

capitalizeSentenceFunction · 0.85
joinMethod · 0.45
mapMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected