mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-18 05:10:57 +00:00
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
This commit is contained in:
13
lib/util/camelcase.js
Normal file
13
lib/util/camelcase.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
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(); })
|
||||
}
|
||||
Reference in New Issue
Block a user