confini-js

Javascript adaptation of python-confini
git clone git://git.defalsify.org/confini-js.git
Log | Files | Refs

commit 092866b8d4290491275abb84aa5a58e738c2b6c8
parent 4ddebdcf4b8ae141b639c473a7aacd5499faa156
Author: nolash <dev@holbrook.no>
Date:   Thu, 12 Nov 2020 19:39:56 +0100

Continue on unmatched directory entry

Diffstat:
MCHANGELOG | 4++++
Mpackage.json | 2+-
Msrc/config.ts | 2+-
Mtests/1_basic.ts | 1+
Atests/testdata/baz.ini | 2++
5 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,7 @@ +* 0.0.4 + - Continue on unmatched file name +* 0.0.3 + - Remove throw on unknown key * 0.0.2 - Add prefix to override * 0.0.1 diff --git a/package.json b/package.json @@ -1,6 +1,6 @@ { "name": "confini", - "version": "0.0.2", + "version": "0.0.4", "description": "Merge all ini configuration files from a folder", "main": "dist/index.js", "scripts": { diff --git a/src/config.ts b/src/config.ts @@ -24,7 +24,7 @@ class Config { for (let i = 0; i < d.length; i++) { const f = d[i]; if (!f.match(r)) { - return; + continue } const fp = path.join(this.filepath, f); diff --git a/tests/1_basic.ts b/tests/1_basic.ts @@ -7,6 +7,7 @@ describe('basic', () => { const c = new Config(__dirname + '/testdata'); c.process(); assert.equal(c.get('FOO_BAR'), 'baz'); + assert.equal(c.get('BAZ_XYZZY'), 666); }); it('override_simple', () => { diff --git a/tests/testdata/baz.ini b/tests/testdata/baz.ini @@ -0,0 +1,2 @@ +[baz] +xyzzy = 666