-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
config-dot-notation
for config files
Default is `false`
- Loading branch information
Showing
5 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,6 +224,36 @@ $ node example.js --foo.bar | |
{ _: [], "foo.bar": true } | ||
``` | ||
|
||
_Note: as of [email protected], `dot-notation` has been split into `dot-notation` (**for CLI args**) and `config-dot-notation`_ | ||
|
||
### config-dot-notation | ||
|
||
* default: `false` | ||
* key: `config-dot-notation` | ||
|
||
Should keys in the config file that contain `.` split into objects? | ||
|
||
example config.json: | ||
```json | ||
{ | ||
"foo.bar": true, | ||
"parent": { | ||
"foo.bar": true | ||
} | ||
} | ||
``` | ||
|
||
```console | ||
$ node example.js --config config.json | ||
{ _: [], "foo.bar": true, parent: { "foo.bar": true } } | ||
``` | ||
|
||
_if enabled:_ | ||
```console | ||
$ node example.js --config config.json | ||
{ _: [], foo: { bar: true }, parent: { foo: { bar: true } } } | ||
``` | ||
|
||
### parse numbers | ||
|
||
* default: `true` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"a": "a", | ||
"nested": { | ||
"b": "b" | ||
}, | ||
"hello.world": true, | ||
"parent": { | ||
"foo.bar": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters