From c9a18d1989ecb5b9f2cffd7592275dd98bd89bac Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Wed, 29 Jan 2025 16:14:35 -0800 Subject: [PATCH] fix: use a typescript-compiant property check --- packages/playwright-core/src/utilsBundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-core/src/utilsBundle.ts b/packages/playwright-core/src/utilsBundle.ts index 1edb5f79b8..82380b36b7 100644 --- a/packages/playwright-core/src/utilsBundle.ts +++ b/packages/playwright-core/src/utilsBundle.ts @@ -34,7 +34,7 @@ export const progress: typeof import('../bundles/utils/node_modules/@types/progr export const SocksProxyAgent: typeof import('../bundles/utils/node_modules/socks-proxy-agent').SocksProxyAgent = require('./utilsBundleImpl').SocksProxyAgent; export const yaml: typeof import('../bundles/utils/node_modules/yaml') = require('./utilsBundleImpl').yaml; export type { Scalar as YAMLScalar, YAMLSeq, YAMLMap, YAMLError, Range as YAMLRange } from '../bundles/utils/node_modules/yaml'; -export const ws: typeof import('../bundles/utils/node_modules/@types/ws') = typeof globalThis.Bun !== 'undefined' ? require('ws') : require('./utilsBundleImpl').ws; +export const ws: typeof import('../bundles/utils/node_modules/@types/ws') = 'Bun' in globalThis ? require('ws') : require('./utilsBundleImpl').ws; export const wsServer: typeof import('../bundles/utils/node_modules/@types/ws').WebSocketServer = require('./utilsBundleImpl').wsServer; export const wsReceiver = require('./utilsBundleImpl').wsReceiver; export const wsSender = require('./utilsBundleImpl').wsSender;