UNPKG

kasi

Version:

A collection of functions for working with different casings.

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