UNPKG

pibb

Version:

Private Institutional Bulletin Board - I2I Platform for Private Transactions

8 lines (6 loc) 205 B
export default function titleize(string) { if (typeof string !== 'string') { throw new TypeError('Expected a string'); } return string.toLowerCase().replace(/(?:^|\s|-)\S/g, x => x.toUpperCase()); }