mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
12 lines
243 B
TypeScript
12 lines
243 B
TypeScript
|
|
/**
|
||
|
|
* Capitalizes the words of the string passed in.
|
||
|
|
* @param str un-capitalized string
|
||
|
|
*/
|
||
|
|
const capitalize = (str: string): string => {
|
||
|
|
return str.replace(/\b\w/g, (letter) => letter.toUpperCase());
|
||
|
|
};
|
||
|
|
|
||
|
|
export default {
|
||
|
|
capitalize,
|
||
|
|
};
|