*Add savePath utility method

This commit is contained in:
Derrick Hammer 2022-12-21 15:15:55 -05:00
parent 302181c707
commit 6e0608c9a9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 1 deletions

View File

@ -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.");