Skip to content

Commit 87fd07b

Browse files
authored
Merge branch 'develop' into abhi-remove-urlEncode
2 parents d5b0634 + cb1dcf7 commit 87fd07b

File tree

8 files changed

+3
-142
lines changed

8 files changed

+3
-142
lines changed

docs/migration/v8-to-v9.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ 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 `arrayify` export has been removed. There is no replacement.
110+
- The `flatten` export has been removed. There is no replacement.
109111
- The `urlEncode` method has been removed. There is no replacement.
110112

111113
### `@sentry/nestjs`

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

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

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
export { applyAggregateErrorsToEvent } from './aggregate-errors';
2-
// eslint-disable-next-line deprecation/deprecation
3-
export { flatten } from './array';
42
export { getBreadcrumbLogLevelFromHttpStatusCode } from './breadcrumb-log-level';
53
export { getComponentName, getDomElement, getLocationHref, htmlTreeAsString } from './browser';
64
export { dsnFromString, dsnToString, makeDsn } from './dsn';
@@ -42,8 +40,6 @@ export {
4240
addContextToFrame,
4341
addExceptionMechanism,
4442
addExceptionTypeValue,
45-
// eslint-disable-next-line deprecation/deprecation
46-
arrayify,
4743
checkOrSetAlreadyCaught,
4844
getEventDescription,
4945
parseSemver,

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,3 @@ function isAlreadyCaptured(exception: unknown): boolean | void {
230230
return (exception as { __sentry_captured__?: boolean }).__sentry_captured__;
231231
} catch {} // eslint-disable-line no-empty
232232
}
233-
234-
/**
235-
* Checks whether the given input is already an array, and if it isn't, wraps it in one.
236-
*
237-
* @param maybeArray Input to turn into an array, if necessary
238-
* @returns The input, if already an array, or an array with the input as the only element, if not
239-
*
240-
* @deprecated This function has been deprecated and will not be replaced.
241-
*/
242-
export function arrayify<T = unknown>(maybeArray: T | T[]): T[] {
243-
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
244-
}

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

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

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Event, Mechanism, StackFrame } from '../../src/types-hoist';
33
import {
44
addContextToFrame,
55
addExceptionMechanism,
6-
arrayify,
76
checkOrSetAlreadyCaught,
87
getEventDescription,
98
uuid4,
@@ -363,27 +362,3 @@ describe('uuid4 generation', () => {
363362
}
364363
});
365364
});
366-
367-
describe('arrayify()', () => {
368-
it('returns arrays untouched', () => {
369-
// eslint-disable-next-line deprecation/deprecation
370-
expect(arrayify([])).toEqual([]);
371-
// eslint-disable-next-line deprecation/deprecation
372-
expect(arrayify(['dogs', 'are', 'great'])).toEqual(['dogs', 'are', 'great']);
373-
});
374-
375-
it('wraps non-arrays with an array', () => {
376-
// eslint-disable-next-line deprecation/deprecation
377-
expect(arrayify(1231)).toEqual([1231]);
378-
// eslint-disable-next-line deprecation/deprecation
379-
expect(arrayify('dogs are great')).toEqual(['dogs are great']);
380-
// eslint-disable-next-line deprecation/deprecation
381-
expect(arrayify(true)).toEqual([true]);
382-
// eslint-disable-next-line deprecation/deprecation
383-
expect(arrayify({})).toEqual([{}]);
384-
// eslint-disable-next-line deprecation/deprecation
385-
expect(arrayify(null)).toEqual([null]);
386-
// eslint-disable-next-line deprecation/deprecation
387-
expect(arrayify(undefined)).toEqual([undefined]);
388-
});
389-
});

packages/node/src/utils/redisCache.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ export function calculateCacheItemSize(response: unknown): number | undefined {
9595
: getSize(response);
9696
}
9797

98-
// TODO(v9): This is inlined from core so we can deprecate `flatten`.
99-
// It's usage can be replaced with `Array.flat` in v9.
10098
type NestedArray<T> = Array<NestedArray<T> | T>;
99+
101100
function flatten<T>(input: NestedArray<T>): T[] {
102101
const result: T[] = [];
103102

packages/utils/src/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
addNormalizedRequestDataToEvent as addNormalizedRequestDataToEvent_imported,
3030
addRequestDataToEvent as addRequestDataToEvent_imported,
3131
applyAggregateErrorsToEvent as applyAggregateErrorsToEvent_imported,
32-
arrayify as arrayify_imported,
3332
baggageHeaderToDynamicSamplingContext as baggageHeaderToDynamicSamplingContext_imported,
3433
basename as basename_imported,
3534
browserPerformanceTimeOrigin as browserPerformanceTimeOrigin_imported,
@@ -63,7 +62,6 @@ import {
6362
extractTraceparentData as extractTraceparentData_imported,
6463
filenameIsInApp as filenameIsInApp_imported,
6564
fill as fill_imported,
66-
flatten as flatten_imported,
6765
forEachEnvelopeItem as forEachEnvelopeItem_imported,
6866
generatePropagationContext as generatePropagationContext_imported,
6967
generateSentryTraceHeader as generateSentryTraceHeader_imported,
@@ -599,18 +597,10 @@ export const isNodeEnv = isNodeEnv_imported;
599597
/** @deprecated Import from `@sentry/core` instead. */
600598
export const loadModule = loadModule_imported;
601599

602-
/** @deprecated Import from `@sentry/core` instead. */
603-
// eslint-disable-next-line deprecation/deprecation
604-
export const flatten = flatten_imported;
605-
606600
/** @deprecated Import from `@sentry/core` instead. */
607601
// eslint-disable-next-line deprecation/deprecation
608602
export const memoBuilder = memoBuilder_imported;
609603

610-
/** @deprecated Import from `@sentry/core` instead. */
611-
// eslint-disable-next-line deprecation/deprecation
612-
export const arrayify = arrayify_imported;
613-
614604
/** @deprecated Import from `@sentry/core` instead. */
615605
export const normalizeUrlToBase = normalizeUrlToBase_imported;
616606

0 commit comments

Comments
 (0)