Refactor to more consistent structure (e.g. "plugins")
This commit is contained in:
17
environ.ts
Normal file
17
environ.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface EnvSettings {
|
||||
BLITZCRANK_API_TOKEN: string;
|
||||
BLITZCRANK_APP_ID: string;
|
||||
}
|
||||
|
||||
export function readEnvSettings(): EnvSettings {
|
||||
// TODO(DWM): I hate this.
|
||||
const BLITZCRANK_API_TOKEN = process.env.BLITZCRANK_API_TOKEN;
|
||||
if (BLITZCRANK_API_TOKEN === undefined || BLITZCRANK_API_TOKEN === null) {
|
||||
throw TypeError();
|
||||
}
|
||||
const BLITZCRANK_APP_ID = process.env.BLITZCRANK_APP_ID;
|
||||
if (BLITZCRANK_APP_ID === undefined || BLITZCRANK_APP_ID === null) {
|
||||
throw TypeError();
|
||||
}
|
||||
return { BLITZCRANK_API_TOKEN, BLITZCRANK_APP_ID };
|
||||
}
|
||||
Reference in New Issue
Block a user