1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

utils global

This commit is contained in:
Kyle Spearrin
2018-05-14 23:41:12 -04:00
parent 29556c5d3b
commit 5850a590ce
4 changed files with 15 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ export class Utils {
static inited = false;
static isNode = false;
static isBrowser = true;
static global: NodeJS.Global | Window = null;
static init() {
if (Utils.inited) {
@@ -14,6 +15,7 @@ export class Utils {
Utils.inited = true;
Utils.isNode = typeof window === 'undefined';
Utils.isBrowser = !Utils.isNode;
Utils.global = Utils.isNode ? global : window;
}
static fromB64ToArray(str: string): Uint8Array {