Skip to content

Commit

Permalink
[page_objects/common_page] convert to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko committed Nov 15, 2019
1 parent e064205 commit 8372210
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class Config {
this[$values] = value;
}

public has(key: string) {
public has(key: string | string[]) {
function recursiveHasCheck(
remainingPath: string[],
values: Record<string, any>,
Expand Down Expand Up @@ -109,7 +109,7 @@ export class Config {
return recursiveHasCheck(path, this[$values], schema);
}

public get(key: string, defaultValue?: any) {
public get(key: string | string[], defaultValue?: any) {
if (!this.has(key)) {
throw new Error(`Unknown config key "${key}"`);
}
Expand Down
Loading

0 comments on commit 8372210

Please sign in to comment.