aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/assert.tsx3
-rw-r--r--utils/env.tsx9
2 files changed, 12 insertions, 0 deletions
diff --git a/utils/assert.tsx b/utils/assert.tsx
new file mode 100644
index 0000000..0ee51a0
--- /dev/null
+++ b/utils/assert.tsx
@@ -0,0 +1,3 @@
+export default function assert(cond : boolean, message?: string) {
+ if(!cond) { throw Error(message); }
+};
diff --git a/utils/env.tsx b/utils/env.tsx
new file mode 100644
index 0000000..1894c1b
--- /dev/null
+++ b/utils/env.tsx
@@ -0,0 +1,9 @@
+import assert from './assert';
+
+const DISPLAY_DOMAIN = process.env.DISPLAY_DOMAIN;
+
+assert(DISPLAY_DOMAIN !== undefined, 'Please set DISPLAY_DOMAIN');
+
+export {
+ DISPLAY_DOMAIN
+};