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

Function capitalizeSentence

console/src/util.ts:105–112  ·  view source on GitHub ↗
(str: string, withPeriod = true)

Source from the content-addressed store, hash-verified

103 * Capitalizes a string by capitalizing the first letter and optionally appending a period.
104 */
105export function capitalizeSentence(str: string, withPeriod = true) {
106 let newStr = str.charAt(0).toUpperCase() + str.slice(1);
107 if (withPeriod && str.charAt(str.length - 1) !== ".") {
108 newStr += ".";
109 }
110
111 return newStr;
112}
113
114/**
115 * e.g. "some-example-string" returns a "Some example string".

Callers 15

onSubmitFunction · 0.90
util.test.tsFile · 0.90
CommandResultFunction · 0.90
handleValidSubmitFunction · 0.90
handleConnectionSubmitFunction · 0.90
handleSourceSubmitFunction · 0.90
handleConnectionSubmitFunction · 0.90
handleSourceSubmitFunction · 0.90
PrivilegesListFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected