14 lines
289 B
TypeScript
14 lines
289 B
TypeScript
|
|
||
|
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 { _, $ }
|