rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
19 lines (15 loc) • 400 B
text/typescript
import type { IDictionary } from "../typescript/i-dictionary";
export function getGlobal(): IDictionary<unknown>
{
if (typeof global !== "undefined")
{
return global;
}
if (typeof window !== "undefined")
{
return window;
}
throw new Error("unsupported environment");
}
declare let global: IDictionary<unknown>;
declare let window: IDictionary<unknown>;