diff --git a/packages/playwright-core/src/utils/index.ts b/packages/playwright-core/src/utils/index.ts index a5219cda6c..67ec09d91d 100644 --- a/packages/playwright-core/src/utils/index.ts +++ b/packages/playwright-core/src/utils/index.ts @@ -26,7 +26,7 @@ export * from './headers'; export * from './hostPlatform'; export * from './httpServer'; export * from './manualPromise'; -export * from './mimeType'; +export * from './isomorphic/mimeType'; export * from './multimap'; export * from './network'; export * from './processLauncher'; diff --git a/packages/playwright-core/src/utils/mimeType.ts b/packages/playwright-core/src/utils/isomorphic/mimeType.ts similarity index 100% rename from packages/playwright-core/src/utils/mimeType.ts rename to packages/playwright-core/src/utils/isomorphic/mimeType.ts diff --git a/packages/trace-viewer/src/ui/attachmentsTab.tsx b/packages/trace-viewer/src/ui/attachmentsTab.tsx index 86d80fe387..7b97513c2d 100644 --- a/packages/trace-viewer/src/ui/attachmentsTab.tsx +++ b/packages/trace-viewer/src/ui/attachmentsTab.tsx @@ -21,12 +21,7 @@ import type { MultiTraceModel } from './modelUtil'; import { PlaceholderPanel } from './placeholderPanel'; import type { AfterActionTraceEventAttachment } from '@trace/trace'; -// TODO: remove local function and restore import -// import { isTextualMimeType } from 'playwright-core/lib/utils'; - -function isTextualMimeType(mimeType: string) { - return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/); -} +import { isTextualMimeType } from '@isomorphic/mimeType'; type Attachment = AfterActionTraceEventAttachment & { traceUrl: string };