Skip to content

Commit 91080a6

Browse files
author
Luca Forstner
committed
feat(core): Deprecate urlEncode
1 parent 2435b87 commit 91080a6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export {
5757
getOriginalFunction,
5858
markFunctionWrapped,
5959
objectify,
60+
// eslint-disable-next-line deprecation/deprecation
6061
urlEncode,
6162
} from './object';
6263
export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './path';

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export function getOriginalFunction(func: WrappedFunction): WrappedFunction | un
9090
*
9191
* @param object An object that contains serializable values
9292
* @returns string Encoded
93+
*
94+
* @deprecated This function is deprecated and will be removed in the next major version of the SDK.
9395
*/
9496
export function urlEncode(object: { [key: string]: any }): string {
9597
return Object.keys(object)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,17 @@ describe('fill()', () => {
130130

131131
describe('urlEncode()', () => {
132132
test('returns empty string for empty object input', () => {
133+
// eslint-disable-next-line deprecation/deprecation
133134
expect(urlEncode({})).toEqual('');
134135
});
135136

136137
test('returns single key/value pair joined with = sign', () => {
138+
// eslint-disable-next-line deprecation/deprecation
137139
expect(urlEncode({ foo: 'bar' })).toEqual('foo=bar');
138140
});
139141

140142
test('returns multiple key/value pairs joined together with & sign', () => {
143+
// eslint-disable-next-line deprecation/deprecation
141144
expect(urlEncode({ foo: 'bar', pickle: 'rick', morty: '4 2' })).toEqual('foo=bar&pickle=rick&morty=4%202');
142145
});
143146
});

0 commit comments

Comments
 (0)