all repos — underbbs @ b8429533df17831ce4f23398d735f1cd97475fd5

decentralized social media client

ts/util.ts (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function _(key: string, value: any | null | undefined = undefined): any | null {
  const x = <any>window;
  if (value !== undefined) {
    x[key] = value;
  }
  return x[key];
}

function $(id: string): HTMLElement | null {
  return document.getElementById(id);
}

export default { _, $ }