Skip to content

Commit 4aa907e

Browse files
authored
ref(node): Remove duplicate function isCjs (#18662)
While working on something else I stumbled over this unused, duplicated function. Also, there was still one implementation in Google Cloud Serverless, which checked for `typeof require !== 'undefined'`, which does not work well all the time (see this PR: #15927). Closes #18663 (added automatically)
1 parent b068af1 commit 4aa907e

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

packages/cloudflare/src/utils/commonjs.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/google-cloud-serverless/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
},
5050
"dependencies": {
5151
"@sentry/core": "10.32.1",
52-
"@sentry/node": "10.32.1"
52+
"@sentry/node": "10.32.1",
53+
"@sentry/node-core": "10.32.1"
5354
},
5455
"devDependencies": {
5556
"@google-cloud/bigquery": "^5.3.0",

packages/google-cloud-serverless/src/sdk.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ import type { Integration, Options } from '@sentry/core';
22
import { applySdkMetadata } from '@sentry/core';
33
import type { NodeClient, NodeOptions } from '@sentry/node';
44
import { getDefaultIntegrationsWithoutPerformance, init as initNode } from '@sentry/node';
5+
import { isCjs } from '@sentry/node-core';
56
import { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';
67
import { googleCloudHttpIntegration } from './integrations/google-cloud-http';
78

8-
function isCjs(): boolean {
9-
return typeof require !== 'undefined';
10-
}
11-
129
function getCjsOnlyIntegrations(): Integration[] {
1310
return isCjs()
1411
? [

0 commit comments

Comments
 (0)