From d6de17b331d966ae06d4b436193aa01d9e9a2e6e Mon Sep 17 00:00:00 2001 From: LaTotty Date: Tue, 26 Jul 2016 18:01:04 +0200 Subject: [PATCH 1/2] convict config validation options added --- convict/convict.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convict/convict.d.ts b/convict/convict.d.ts index 05323de269..07bf5940ff 100644 --- a/convict/convict.d.ts +++ b/convict/convict.d.ts @@ -41,7 +41,7 @@ declare module "convict" { load(conf: Object): void; loadFile(file: string): void; loadFile(files: string[]): void; - validate(): void; + validate(options?: { strict?: boolean }): void; /** * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} * @returns {Object} A {JSON} compliant {Object} From ee4933753a835979cbd455e22114f0fef75776b0 Mon Sep 17 00:00:00 2001 From: LaTotty Date: Tue, 26 Jul 2016 18:01:47 +0200 Subject: [PATCH 2/2] convict config validation options test added --- convict/convict-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convict/convict-tests.ts b/convict/convict-tests.ts index 3bd64c5929..56326c00b3 100644 --- a/convict/convict-tests.ts +++ b/convict/convict-tests.ts @@ -104,7 +104,7 @@ conf.loadFile(['./configs/always.json', './configs/sometimes.json']); // perform validation -conf.validate(); +conf.validate({ strict: true }); var port: number = conf.default('port');