*Update LoadOptions
This commit is contained in:
parent
f3edf4ff07
commit
d260933384
18
src/index.ts
18
src/index.ts
|
@ -20,11 +20,11 @@ export interface Options {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LoadOptions {
|
export interface LoadOptions {
|
||||||
hash?: string;
|
hash?: string | boolean;
|
||||||
query?: string;
|
query?: string | boolean;
|
||||||
env?: object;
|
env?: object | boolean;
|
||||||
argv?: string[];
|
argv?: string[] | boolean;
|
||||||
config?: string;
|
config?: string | boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,19 +99,19 @@ export default class Config {
|
||||||
|
|
||||||
public load(options: LoadOptions) {
|
public load(options: LoadOptions) {
|
||||||
if (options.hash) {
|
if (options.hash) {
|
||||||
this.parseHash(options.hash);
|
this.parseHash(options.hash as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.query) {
|
if (options.query) {
|
||||||
this.parseQuery(options.query);
|
this.parseQuery(options.query as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.env) {
|
if (options.env) {
|
||||||
this.parseEnv(options.env);
|
this.parseEnv(options.env as object);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.argv) {
|
if (options.argv) {
|
||||||
this.parseArg(options.argv);
|
this.parseArg(options.argv as string[]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prefix = this.getPrefix();
|
this.prefix = this.getPrefix();
|
||||||
|
|
Loading…
Reference in New Issue