Skip to content

Commit 26f7d02

Browse files
committed
remove VersionString type -> fix TS3.8
1 parent 0c08418 commit 26f7d02

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

packages/core/src/carrier.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Client, Integration, MetricsAggregator, Scope, VersionString } from '@sentry/types';
1+
import type { Client, Integration, MetricsAggregator, Scope } from '@sentry/types';
22
import { GLOBAL_OBJ, SDK_VERSION } from '@sentry/utils';
33
import type { AsyncContextStack } from './asyncContext/stackStrategy';
44
import type { AsyncContextStrategy } from './asyncContext/types';
@@ -12,9 +12,8 @@ export interface Carrier {
1212
}
1313

1414
type VersionedCarrier = {
15-
[key: VersionString]: SentryCarrier;
16-
version?: VersionString;
17-
};
15+
version?: string;
16+
} & Record<Exclude<string, 'version'>, SentryCarrier>;
1817

1918
interface SentryCarrier {
2019
acs?: AsyncContextStrategy;

packages/types/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export type { Extra, Extras } from './extra';
5757
export type { Hub } from './hub';
5858
export type { Integration, IntegrationClass, IntegrationFn } from './integration';
5959
export type { Mechanism } from './mechanism';
60-
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation, VersionString } from './misc';
60+
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './misc';
6161
export type { ClientOptions, Options } from './options';
6262
export type { Package } from './package';
6363
export type { PolymorphicEvent, PolymorphicRequest } from './polymorphics';

packages/types/src/misc.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,3 @@ export interface WorkerLocation {
6565
export type Primitive = number | string | boolean | bigint | symbol | null | undefined;
6666

6767
export type HttpHeaderValue = string | string[] | number | null;
68-
69-
/**
70-
* Type representing a semver version string
71-
*/
72-
export type VersionString = `${number}.${number}.${number}${`-${string}${string}` | ''}`;

packages/utils/src/worldwide.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/* eslint-disable @typescript-eslint/no-explicit-any */
1414

15-
import type { Client, MetricsAggregator, Scope, VersionString } from '@sentry/types';
15+
import type { Client, MetricsAggregator, Scope } from '@sentry/types';
1616

1717
import type { SdkSource } from './env';
1818
import { SDK_VERSION } from './version';
@@ -72,9 +72,8 @@ export type InternalGlobal = {
7272
* file.
7373
*/
7474
_sentryDebugIds?: Record<string, string>;
75-
__SENTRY__: {
76-
[key: VersionString]: SentryCarrier;
77-
version?: VersionString;
75+
__SENTRY__: Record<Exclude<string, 'version'>, SentryCarrier> & {
76+
version?: string;
7877
} & BackwardsCompatibleSentryCarrier;
7978
/**
8079
* Raw module metadata that is injected by bundler plugins.

0 commit comments

Comments
 (0)