mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-21 00:28:23 +08:00
Merge pull request #10297 from latotty/convict-validate-stict
[convict] Added options (strict) to convict Config.validate
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
2
convict/convict.d.ts
vendored
2
convict/convict.d.ts
vendored
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user