UNPKG

open-props

Version:

<div align="center"> ![Open Props Logo](https://user-images.githubusercontent.com/1134620/141246730-7df4cf2a-6249-42ca-a01b-494c3ccddabe.png)

12 lines (11 loc) 304 B
export const camelize = text => { text = text.replace(/[-]+(.)?/g, (_, c) => c ? c.toUpperCase() : '') return text.substr(0, 1).toLowerCase() + text.substr(1) } export const mapToObjectNotation = props => { for (var prop in props) props[camelize(prop)] = props[prop] return props }