Skip to content

Commit d5b0634

Browse files
committed
feat(core)!: Remove urlEncode method
1 parent 2d4f8e9 commit d5b0634

File tree

5 files changed

+1
-40
lines changed

5 files changed

+1
-40
lines changed

docs/migration/v8-to-v9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ It will be removed in a future major version.
106106

107107
- The `getNumberOfUrlSegments` method has been removed. There is no replacement.
108108
- The `validSeverityLevels` export has been removed. There is no replacement.
109+
- The `urlEncode` method has been removed. There is no replacement.
109110

110111
### `@sentry/nestjs`
111112

packages/core/src/utils-hoist/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export {
6161
getOriginalFunction,
6262
markFunctionWrapped,
6363
objectify,
64-
// eslint-disable-next-line deprecation/deprecation
65-
urlEncode,
6664
} from './object';
6765
export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './path';
6866
export { makePromiseBuffer } from './promisebuffer';

packages/core/src/utils-hoist/object.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,6 @@ export function getOriginalFunction<T extends Function>(func: WrappedFunction<T>
8686
return func.__sentry_original__;
8787
}
8888

89-
/**
90-
* Encodes given object into url-friendly format
91-
*
92-
* @param object An object that contains serializable values
93-
* @returns string Encoded
94-
*
95-
* @deprecated This function is deprecated and will be removed in the next major version of the SDK.
96-
*/
97-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
98-
export function urlEncode(object: { [key: string]: any }): string {
99-
return Object.entries(object)
100-
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
101-
.join('&');
102-
}
103-
10489
/**
10590
* Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their
10691
* non-enumerable properties attached.

packages/core/test/utils-hoist/object.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
fill,
1212
markFunctionWrapped,
1313
objectify,
14-
urlEncode,
1514
} from '../../src/utils-hoist/object';
1615
import { testOnlyIfNodeVersionAtLeast } from './testutils';
1716

@@ -128,23 +127,6 @@ describe('fill()', () => {
128127
});
129128
});
130129

131-
describe('urlEncode()', () => {
132-
test('returns empty string for empty object input', () => {
133-
// eslint-disable-next-line deprecation/deprecation
134-
expect(urlEncode({})).toEqual('');
135-
});
136-
137-
test('returns single key/value pair joined with = sign', () => {
138-
// eslint-disable-next-line deprecation/deprecation
139-
expect(urlEncode({ foo: 'bar' })).toEqual('foo=bar');
140-
});
141-
142-
test('returns multiple key/value pairs joined together with & sign', () => {
143-
// eslint-disable-next-line deprecation/deprecation
144-
expect(urlEncode({ foo: 'bar', pickle: 'rick', morty: '4 2' })).toEqual('foo=bar&pickle=rick&morty=4%202');
145-
});
146-
});
147-
148130
describe('extractExceptionKeysForMessage()', () => {
149131
test('no keys', () => {
150132
expect(extractExceptionKeysForMessage({}, 10)).toEqual('[object has no keys]');

packages/utils/src/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ import {
153153
triggerHandlers as triggerHandlers_imported,
154154
truncate as truncate_imported,
155155
updateRateLimits as updateRateLimits_imported,
156-
urlEncode as urlEncode_imported,
157156
uuid4 as uuid4_imported,
158157
vercelWaitUntil as vercelWaitUntil_imported,
159158
watchdogTimer as watchdogTimer_imported,
@@ -615,10 +614,6 @@ export const arrayify = arrayify_imported;
615614
/** @deprecated Import from `@sentry/core` instead. */
616615
export const normalizeUrlToBase = normalizeUrlToBase_imported;
617616

618-
/** @deprecated Import from `@sentry/core` instead. */
619-
// eslint-disable-next-line deprecation/deprecation
620-
export const urlEncode = urlEncode_imported;
621-
622617
/** @deprecated Import from `@sentry/core` instead. */
623618
// eslint-disable-next-line deprecation/deprecation
624619
export const extractPathForTransaction = extractPathForTransaction_imported;

0 commit comments

Comments
 (0)