LeanKit-Labs/configya — pull request #7 by dcneiner (2014-12-11 00:04:41+00:00)
Title: Added support for camelCase keys, change nested separator to __

Hey @arobson @ifandelse @digitalBush

This started as a look into supporting camelCase keys, but allowing them to be overridden by environment variables.

I looked first into other separators, but they will not work consistently since the base support seems to be for letters, numbers and underscores

After initial discussion with @arobson, I was going to look into conditionally supporting camel case only for keys with `__` in them. After also getting @rniemeyer and @ifandelse to weigh in, the idea was we should switch to only supporting `__` as the nested key separator, allowing `_` to separate words.

An added bonus is that the slightly odd signature of `__` helps you visually see what will become a new level vs just a multi-word key.

So `AUTH__USER_NAME=doug` and `ANALYTICS__HOST__APP_NAME=tracker` would become:

```js
{
auth: {
userName: "doug"
},
analytics: {
host: {
appName: "tracker"
}
}
}
```

However, since this is a breaking change, and can be quite subjective – this PR is the start of the discussion. It could be modified to allow this to be configured or support both, but since we are primarily looking to use this at LeanKit, the default should be what our internal standard is (whatever that ends up being).