From 199e45bc8cef44b86c6fa0b8ab28258e4e905c97 Mon Sep 17 00:00:00 2001 From: TheVTM Date: Tue, 8 Nov 2016 17:00:56 -0200 Subject: [PATCH] Added missing nconf.required(keys) and Provider.required(keys) methods. --- nconf/nconf-tests.ts | 2 ++ nconf/nconf.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nconf/nconf-tests.ts b/nconf/nconf-tests.ts index dd33514c23..db105dfefe 100644 --- a/nconf/nconf-tests.ts +++ b/nconf/nconf-tests.ts @@ -57,6 +57,7 @@ nconf.init(opts); p = nconf.overrides(); p = nconf.overrides(opts); nconf.remove(str); +bool = nconf.required(strArr); store = nconf.create(str, opts); str = nconf.key(value, value); @@ -118,6 +119,7 @@ p = p.defaults(opts); p.init(opts); p = p.overrides(opts); p.remove(str); +bool = p.required(strArr); store = p.create(str, opts); // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nconf/nconf.d.ts b/nconf/nconf.d.ts index 005d129199..6a42dc0100 100644 --- a/nconf/nconf.d.ts +++ b/nconf/nconf.d.ts @@ -32,6 +32,7 @@ declare module "nconf" { export function init(options?: IOptions): void; export function overrides(options?: IOptions): Provider; export function remove(name: string): void; + export function required(keys: string[]): boolean; export function create(name: string, options: IOptions): IStore; export function key(...values: any[]): string; @@ -95,6 +96,7 @@ declare module "nconf" { init(options?: IOptions): void; overrides(options?: IOptions): Provider; remove(name: string): void; + required(keys: string[]): boolean; create(name: string, options: IOptions): IStore; }