UNPKG

libmodulor

Version:

A TypeScript library to create platform-agnostic applications

9 lines (8 loc) 234 B
export function humanize(value) { let res = value .replace(/([a-z])([A-Z])/g, '$1 $2') .replace(/([a-z])_([a-z])/g, '$1 $2') .trim(); res = res.charAt(0).toUpperCase() + res.slice(1); return res; }