Skip to content

Commit

Permalink
Adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Nov 17, 2023
1 parent 5072957 commit 2b5722d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/x-global/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ declare const window: unknown;
// The [key: string]: unknown part here is for not-everywhere globals
// such as `Buffer` (that won't exist is deno/window global environments)
type GlobalThis = typeof globalThis & {
env?: Record<string, string>;
process?: {
env?: Record<string, string>;
};

[key: string]: unknown;
};
Expand Down Expand Up @@ -60,6 +62,6 @@ export function extractGlobal <N extends GlobalNames, T extends GlobalType<N>> (
*/
export function exposeGlobal <N extends GlobalNames, T extends GlobalType<N>> (name: N, fallback: unknown): void {
if (typeof xglobal[name] === 'undefined') {
xglobal[name] = fallback as T;
(xglobal as Record<string, unknown>)[name] = fallback as T;
}
}

0 comments on commit 2b5722d

Please sign in to comment.