From 28a724826f01389ec83ae0a1161d20f728e6f92c Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 6 May 2022 13:07:53 +0100 Subject: [PATCH] fix: hard code tag Using the constructor name is unreliable since it can be changed by code minifiers. --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index eaa8b42..575657b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,8 @@ export interface WebSocketsInit extends AbortOptions, WebSocketOptions { } export class WebSockets implements Transport { + static tag = 'WebSockets' + private readonly init?: WebSocketsInit constructor (init?: WebSocketsInit) { @@ -30,7 +32,7 @@ export class WebSockets implements Transport { } get [Symbol.toStringTag] () { - return this.constructor.name + return WebSockets.tag } get [symbol] (): true {