Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yentsun committed Feb 20, 2019
2 parents 23529aa + 52e523f commit 9cd0260
Show file tree
Hide file tree
Showing 12 changed files with 909 additions and 3,497 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[3.2.0]
-------
- [ ] Increase code coverage
[4.0.0] - 2019-02-20
--------------------
- [x] Increase code coverage
- [x] Move away from PEG.js parser to custom one


[3.1.0] - 2018-11-02
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Main features:
- basic typecasting (values that look like numbers are returned as numbers)
- valid JSON strings are parsed
- no dependencies other than `lodash.merge`
- parsing is done via PEG.js grammar

Apart from parsing ini format, it achieves two things:
- *never repeat config for different environments* - you have 'default'
Expand All @@ -39,7 +38,6 @@ switchOne = on
switchTwo = off
flag = true
falseFlag = false
null:null

[default.log]
level = DEBUG
Expand Down Expand Up @@ -75,7 +73,6 @@ will result in the following config object:
switchTwo: false,
flag: true,
falseFlag: false,
null: null,
log: { level: 'INFO' },
keyDEV: 'dev',
array: [ 'one', 'two', 'three', 3 ],
Expand Down
5 changes: 1 addition & 4 deletions external.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ const modules = {
}
};

module.exports = (environment, value) => {
const currentEnvironment = process.env.NODE_ENV || 'development'; // TODO remove this duplicate
if (![currentEnvironment, 'default'].includes(environment)) // ignore value if its not current environment
return value;
module.exports = (value) => {
const [module, key] = value.split('::');
const moduleName = module.toLowerCase();
if (!(moduleName in modules))
Expand Down
62 changes: 0 additions & 62 deletions grammar.pegjs

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');
const {promisify} = require('util');
const {parse} = require('./parser');
const parse = require('./parser');
const merge = require('lodash.merge');


Expand Down
Loading

0 comments on commit 9cd0260

Please sign in to comment.