Skip to content

Commit

Permalink
fix(ses): widen type of globalThis in Compartment (#2644)
Browse files Browse the repository at this point in the history
`globalThis` can contain `Symbol` keys, so it is more correctly typed as
`Record<PropertyKey, any>`.

This also widens the type of the `globals` parameter in the
`Compartment` constructor.
  • Loading branch information
boneskull authored Nov 22, 2024
1 parent 27ca207 commit ff6a5ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ses/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,12 @@ declare global {

// Deprecated:
constructor(
globals?: Record<string, any> | undefined,
globals?: Record<PropertyKey, any> | undefined,
modules?: Record<string, ModuleDescriptor>,
options?: CompartmentOptions,
);

get globalThis(): Record<string, any>;
get globalThis(): Record<PropertyKey, any>;

get name(): string;

Expand Down

0 comments on commit ff6a5ab

Please sign in to comment.