Skip to content

Commit

Permalink
fix: use Symbol.for to make sure two concurrent versions of ts-patter…
Browse files Browse the repository at this point in the history
…n are compatible with one-another
  • Loading branch information
gvergnaud committed Jun 22, 2023
1 parent ba408d8 commit d6d2e23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internals/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* @internal
*/

export const matcher = Symbol('@ts-pattern/matcher');
export const matcher = Symbol.for('@ts-pattern/matcher');
export type matcher = typeof matcher;

export const unset = Symbol('@ts-pattern/unset');
export const unset = Symbol.for('@ts-pattern/unset');
export type unset = typeof unset;

export const isVariadic = Symbol('@ts-pattern/isVariadic');
export const isVariadic = Symbol.for('@ts-pattern/isVariadic');
export type isVariadic = typeof isVariadic;

export const anonymousSelectKey = '@ts-pattern/anonymous-select-key';
export type anonymousSelectKey = typeof anonymousSelectKey;

export const override = Symbol('@ts-pattern/override');
export const override = Symbol.for('@ts-pattern/override');
export type override = typeof override;

0 comments on commit d6d2e23

Please sign in to comment.