all repos — underbbs @ 2244bbcf7af3ee1b3489243a3fc74e3b6eb603ba

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 { _, $ }