*Add savePath utility method
This commit is contained in:
parent
302181c707
commit
6e0608c9a9
|
@ -94,7 +94,7 @@ export default class Config {
|
|||
}
|
||||
}
|
||||
|
||||
public save(file: string, data: object) {
|
||||
public save(file: string, data: object): void {
|
||||
assert(typeof data === "object");
|
||||
assert(!Array.isArray(data));
|
||||
|
||||
|
@ -109,6 +109,10 @@ export default class Config {
|
|||
this.open(fullPath);
|
||||
}
|
||||
|
||||
public savePath(file: string, path: string): void {
|
||||
this.save(file, this.get(path));
|
||||
}
|
||||
|
||||
public set(key: string, value: any) {
|
||||
assert(typeof key === "string", "Key must be a string.");
|
||||
|
||||
|
|
Loading…
Reference in New Issue