*Update dist
This commit is contained in:
parent
7c631f3af5
commit
647dc9a2ec
|
@ -45,18 +45,7 @@ export default class Config {
|
||||||
set(key: string, value: any): void;
|
set(key: string, value: any): void;
|
||||||
has(key: string): boolean;
|
has(key: string): boolean;
|
||||||
get(key: string, fallback?: any): any;
|
get(key: string, fallback?: any): any;
|
||||||
typeOf(
|
typeOf(key: string): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null";
|
||||||
key: string
|
|
||||||
):
|
|
||||||
| "string"
|
|
||||||
| "number"
|
|
||||||
| "bigint"
|
|
||||||
| "boolean"
|
|
||||||
| "symbol"
|
|
||||||
| "undefined"
|
|
||||||
| "object"
|
|
||||||
| "function"
|
|
||||||
| "null";
|
|
||||||
str(key: string, fallback?: any): any;
|
str(key: string, fallback?: any): any;
|
||||||
int(key: any, fallback?: any): any;
|
int(key: any, fallback?: any): any;
|
||||||
uint(key: any, fallback?: any): any;
|
uint(key: any, fallback?: any): any;
|
||||||
|
|
|
@ -135,6 +135,9 @@ class Config {
|
||||||
(0, bsert_1.default)(typeof data === "object");
|
(0, bsert_1.default)(typeof data === "object");
|
||||||
(0, bsert_1.default)(!Array.isArray(data));
|
(0, bsert_1.default)(!Array.isArray(data));
|
||||||
const fullPath = path_1.default.join(this.str("configdir"), file);
|
const fullPath = path_1.default.join(this.str("configdir"), file);
|
||||||
|
if (!fs_1.default.existsSync(fullPath)) {
|
||||||
|
fs_1.default.mkdirSync(fullPath, { recursive: true });
|
||||||
|
}
|
||||||
fs_1.default.writeFileSync(fullPath, JSON.stringify(data));
|
fs_1.default.writeFileSync(fullPath, JSON.stringify(data));
|
||||||
this.openJson(fullPath);
|
this.openJson(fullPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue