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