Skip to content

Commit f5eedd8

Browse files
committed
ref: Move isBrowser util fn from replay to util
We need this in the new feedback integration.
1 parent 6921f06 commit f5eedd8

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

packages/replay/jest.setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import type { ReplayContainer, Session } from './src/types';
1010

1111
type MockTransport = jest.MockedFunction<Transport['send']>;
1212

13-
jest.mock('./src/util/isBrowser', () => {
13+
jest.mock('@sentry/utils', () => {
14+
const original = jest.requireActual('@sentry/utils');
1415
return {
16+
...original,
1517
isBrowser: () => true,
1618
};
1719
});

packages/replay/src/integration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getCurrentHub } from '@sentry/core';
22
import type { BrowserClientReplayOptions, Integration } from '@sentry/types';
3-
import { dropUndefinedKeys } from '@sentry/utils';
3+
import { dropUndefinedKeys, isBrowser } from '@sentry/utils';
44

55
import {
66
DEFAULT_FLUSH_MAX_DELAY,
@@ -12,7 +12,6 @@ import {
1212
import { ReplayContainer } from './replay';
1313
import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions, SendBufferedReplayOptions } from './types';
1414
import { getPrivacyOptions } from './util/getPrivacyOptions';
15-
import { isBrowser } from './util/isBrowser';
1615
import { maskAttribute } from './util/maskAttribute';
1716

1817
const MEDIA_SELECTORS =

packages/utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ export * from './userIntegrations';
3232
export * from './cache';
3333
export * from './eventbuilder';
3434
export * from './anr';
35+
export * from './isBrowser';

packages/replay/src/util/isBrowser.ts renamed to packages/utils/src/isBrowser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNodeEnv } from '@sentry/utils';
1+
import { isNodeEnv } from './node';
22

33
/**
44
* Returns true if we are in the browser.

0 commit comments

Comments
 (0)