*Update dist

This commit is contained in:
Derrick Hammer 2022-09-21 16:28:05 -04:00
parent d50269aac7
commit f7751a3995
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 6 additions and 0 deletions

1
dist/index.d.ts vendored
View File

@ -40,6 +40,7 @@ export default class Config {
open(file: string): void; open(file: string): void;
openDir(dir: string): void; openDir(dir: string): void;
openJson(file: string): void; openJson(file: string): void;
saveConfigJson(data: object): void;
filter(name: string): Config; filter(name: string): Config;
set(key: string, value: any): void; set(key: string, value: any): void;
has(key: string): boolean; has(key: string): boolean;

5
dist/index.js vendored
View File

@ -134,6 +134,11 @@ class Config {
} }
this.prefix = this.getPrefix(); this.prefix = this.getPrefix();
} }
saveConfigJson(data) {
(0, bsert_1.default)(typeof data === "object");
(0, bsert_1.default)(!Array.isArray(data));
fs_1.default.writeFileSync(this.str("configdir"), JSON.stringify(data));
}
filter(name) { filter(name) {
(0, bsert_1.default)(typeof name === "string"); (0, bsert_1.default)(typeof name === "string");
const child = new Config(this.module); const child = new Config(this.module);