From 76000f8fa11dde2f67efdb22a87c4644ea49f9eb Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 30 Jan 2021 19:58:15 +0100 Subject: :sparkles: Util --- src/util/Config.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/util/Config.ts (limited to 'src/util/Config.ts') diff --git a/src/util/Config.ts b/src/util/Config.ts new file mode 100644 index 00000000..c948d0eb --- /dev/null +++ b/src/util/Config.ts @@ -0,0 +1,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 Config.get(); +} + +function set(val: any) { + return Config.set(val); +} + +export default { + init, + get: get, + set: set, +}; -- cgit 1.5.1