summary refs log tree commit diff
path: root/src/util/Config.ts
blob: 4b644e2ffc7df291fc0720e6ebb53fc36727dab5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import "missing-native-js-functions";
import db from "./Database";
import { DefaultOptions } from "./Constants";
import { ProviderCache } from "lambert-db";
var Config: ProviderCache;

async function init() {
	Config = db.data.config({}).cache();
	await Config.init();
	await Config.set(DefaultOptions.merge(Config.cache || {}));
}

function get() {
	return <DefaultOptions>Config.get();
}

function set(val: any) {
	return Config.set(val);
}

export default {
	init,
	get: get,
	set: set,
};