underbbs/ts/util.ts

14 lines
289 B
TypeScript
Raw Normal View History

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