From ec8b72f24fc47947136dafbff73f5793ceba2a3a Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sun, 16 Dec 2018 15:11:52 -0500 Subject: [PATCH 1/2] Clarify `argv` and `parse` arguments --- types/rc/index.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/rc/index.d.ts b/types/rc/index.d.ts index 9a2c6783f6..24b763b663 100644 --- a/types/rc/index.d.ts +++ b/types/rc/index.d.ts @@ -6,8 +6,16 @@ declare function rc( name: string, defaults?: any, + /** + * Parsed argv object. For example, if args were '--foo bar' then this value might be {foo: 'bar'} + * If null then rc's default argv parser will parse process.argv + */ argv?: {} | null, + /** + * Custom config file parser. + * Will be passed the string contents of each discovered config file and should return a parsed object dictionary. + */ parse?: ((content: string) => any) | null ): any; -export = rc; \ No newline at end of file +export = rc; From 3c92017bd707565cffaf9e50051fdd78f2bf07c9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 17 Dec 2018 12:40:40 -0800 Subject: [PATCH 2/2] Update index.d.ts --- types/rc/index.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/rc/index.d.ts b/types/rc/index.d.ts index 24b763b663..3ab9cc3a26 100644 --- a/types/rc/index.d.ts +++ b/types/rc/index.d.ts @@ -7,13 +7,14 @@ declare function rc( name: string, defaults?: any, /** - * Parsed argv object. For example, if args were '--foo bar' then this value might be {foo: 'bar'} - * If null then rc's default argv parser will parse process.argv + * Parsed argv object. For example, if args is `--foo bar`, then this value should be `{foo: 'bar'}` + * If `argv` is `null` or `undefined`, then `rc`'s default parser will parse `process.argv`. */ argv?: {} | null, /** * Custom config file parser. - * Will be passed the string contents of each discovered config file and should return a parsed object dictionary. + * This function will be passed the string contents of each + * discovered configuration file should return a parsed object dictionary. */ parse?: ((content: string) => any) | null ): any;