mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Fix 'argv' (which is not a simple array).
This commit is contained in:
5
rc/index.d.ts
vendored
5
rc/index.d.ts
vendored
@@ -6,7 +6,8 @@
|
||||
declare function rc(
|
||||
name: string,
|
||||
defaults?: any,
|
||||
argv?: string[] | null,
|
||||
parse?: ((content: string) => any) | null): any;
|
||||
argv?: {} | null,
|
||||
parse?: ((content: string) => any) | null
|
||||
): any;
|
||||
|
||||
export = rc;
|
||||
@@ -1,16 +1,33 @@
|
||||
import rc = require("rc")
|
||||
|
||||
let confA = rc("appname", {
|
||||
let confA = rc("appname1", {
|
||||
port: 2468,
|
||||
|
||||
views: {
|
||||
engine: "jade"
|
||||
}
|
||||
});
|
||||
|
||||
let appCfg = rc("appname", {}, null, function parse(s) {
|
||||
////////////////////
|
||||
|
||||
let appCfg = rc("appname2", {}, null, function parse(s) {
|
||||
return JSON.parse(s.toLowerCase());
|
||||
});
|
||||
|
||||
appCfg.configs[0];
|
||||
appCfg.configs[1];
|
||||
appCfg.config;
|
||||
appCfg.config;
|
||||
|
||||
////////////////////
|
||||
|
||||
let customArgv = rc("appname3", {
|
||||
option: true
|
||||
},
|
||||
{
|
||||
option: false,
|
||||
envOption: 24,
|
||||
argv: {
|
||||
remain: [],
|
||||
cooked: ['--no-option', '--envOption', '24'],
|
||||
original: ['--no-option', '--envOption=24']
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user