diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md index 20c29bbffac3..6839442e3836 100644 --- a/docs/migration/v8-to-v9.md +++ b/docs/migration/v8-to-v9.md @@ -108,6 +108,7 @@ It will be removed in a future major version. - The `validSeverityLevels` export has been removed. There is no replacement. - The `arrayify` export has been removed. There is no replacement. - The `flatten` export has been removed. There is no replacement. +- The `urlEncode` method has been removed. There is no replacement. ### `@sentry/nestjs` diff --git a/packages/core/src/utils-hoist/index.ts b/packages/core/src/utils-hoist/index.ts index e8cc031f84f7..9ba63cb366fc 100644 --- a/packages/core/src/utils-hoist/index.ts +++ b/packages/core/src/utils-hoist/index.ts @@ -57,8 +57,6 @@ export { getOriginalFunction, markFunctionWrapped, objectify, - // eslint-disable-next-line deprecation/deprecation - urlEncode, } from './object'; export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './path'; export { makePromiseBuffer } from './promisebuffer'; diff --git a/packages/core/src/utils-hoist/object.ts b/packages/core/src/utils-hoist/object.ts index 7d779cf6e211..31d1d862d01f 100644 --- a/packages/core/src/utils-hoist/object.ts +++ b/packages/core/src/utils-hoist/object.ts @@ -86,21 +86,6 @@ export function getOriginalFunction(func: WrappedFunction return func.__sentry_original__; } -/** - * Encodes given object into url-friendly format - * - * @param object An object that contains serializable values - * @returns string Encoded - * - * @deprecated This function is deprecated and will be removed in the next major version of the SDK. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function urlEncode(object: { [key: string]: any }): string { - return Object.entries(object) - .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) - .join('&'); -} - /** * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their * non-enumerable properties attached. diff --git a/packages/core/test/utils-hoist/object.test.ts b/packages/core/test/utils-hoist/object.test.ts index ed83b5d87aef..255c4ed428f5 100644 --- a/packages/core/test/utils-hoist/object.test.ts +++ b/packages/core/test/utils-hoist/object.test.ts @@ -11,7 +11,6 @@ import { fill, markFunctionWrapped, objectify, - urlEncode, } from '../../src/utils-hoist/object'; import { testOnlyIfNodeVersionAtLeast } from './testutils'; @@ -128,23 +127,6 @@ describe('fill()', () => { }); }); -describe('urlEncode()', () => { - test('returns empty string for empty object input', () => { - // eslint-disable-next-line deprecation/deprecation - expect(urlEncode({})).toEqual(''); - }); - - test('returns single key/value pair joined with = sign', () => { - // eslint-disable-next-line deprecation/deprecation - expect(urlEncode({ foo: 'bar' })).toEqual('foo=bar'); - }); - - test('returns multiple key/value pairs joined together with & sign', () => { - // eslint-disable-next-line deprecation/deprecation - expect(urlEncode({ foo: 'bar', pickle: 'rick', morty: '4 2' })).toEqual('foo=bar&pickle=rick&morty=4%202'); - }); -}); - describe('extractExceptionKeysForMessage()', () => { test('no keys', () => { expect(extractExceptionKeysForMessage({}, 10)).toEqual('[object has no keys]'); diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 80dfd17ab72c..c7b63720f706 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -151,7 +151,6 @@ import { triggerHandlers as triggerHandlers_imported, truncate as truncate_imported, updateRateLimits as updateRateLimits_imported, - urlEncode as urlEncode_imported, uuid4 as uuid4_imported, vercelWaitUntil as vercelWaitUntil_imported, watchdogTimer as watchdogTimer_imported, @@ -605,10 +604,6 @@ export const memoBuilder = memoBuilder_imported; /** @deprecated Import from `@sentry/core` instead. */ export const normalizeUrlToBase = normalizeUrlToBase_imported; -/** @deprecated Import from `@sentry/core` instead. */ -// eslint-disable-next-line deprecation/deprecation -export const urlEncode = urlEncode_imported; - /** @deprecated Import from `@sentry/core` instead. */ // eslint-disable-next-line deprecation/deprecation export const extractPathForTransaction = extractPathForTransaction_imported;