UNPKG

gatsby-theme-headless-wordpress

Version:

Creates pages for all of the content source by gatsby-source-wordpress.

11 lines (9 loc) 273 B
const toCamel = string => { if (!string) { return null } string = string.replace(/[-_\s.]+(.)?/g, (_, c) => (c ? c.toUpperCase() : "")) return string.substr(0, 1).toLowerCase() + string.substr(1) } exports.default = toCamel exports.toCamel = toCamel