UNPKG

kasi

Version:

A collection of functions for working with different casings.

11 lines (10 loc) 263 B
/* IMPORT */ import toSpaceCase from './to_space_case.js'; /* HELPERS */ const upperRe = /^\w|\s\w/g; /* MAIN */ const toTitleCase = (value) => { return toSpaceCase(value).replaceAll(upperRe, _ => _.toUpperCase()); }; /* EXPORT */ export default toTitleCase;