Files
homebridge/lib/util/camelcase.js
Nick Farina dbedf7fe01 Convert to ES5, add web server
* No compilation step
 * Beginnings of web interface
 * Simple express server; React-based frontend
 * CommonJS style across codebase; auto-converts to RequireJS for browser
 * Using diffsync for realtime UI
 * "Provider" -> "Plugin"
 * Plugins expose one or more Providers
2015-08-11 22:27:59 -07:00

14 lines
352 B
JavaScript

module.exports = {
camelCaseToRegularForm: camelCaseToRegularForm
}
// Converts "accessToken" to "Access Token"
function camelCaseToRegularForm(camelCase) {
return camelCase
// insert a space before all caps
.replace(/([A-Z])/g, ' $1')
// uppercase the first character
.replace(/^./, function(str){ return str.toUpperCase(); })
}