Skip to content

Commit

Permalink
feat(core)!: Remove flatten method (#14784)
Browse files Browse the repository at this point in the history
ref: #14268

Deprecation PR:
#14454

Removes `flatten`. This has no replacement.
  • Loading branch information
AbhiPrasad authored Dec 18, 2024
1 parent 43f37df commit cb1dcf7
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 98 deletions.
1 change: 1 addition & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ It will be removed in a future major version.
- The `getNumberOfUrlSegments` method has been removed. There is no replacement.
- 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.

### `@sentry/nestjs`

Expand Down
22 changes: 0 additions & 22 deletions packages/core/src/utils-hoist/array.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/core/src/utils-hoist/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export { applyAggregateErrorsToEvent } from './aggregate-errors';
// eslint-disable-next-line deprecation/deprecation
export { flatten } from './array';
export { getBreadcrumbLogLevelFromHttpStatusCode } from './breadcrumb-log-level';
export { getComponentName, getDomElement, getLocationHref, htmlTreeAsString } from './browser';
export { dsnFromString, dsnToString, makeDsn } from './dsn';
Expand Down
67 changes: 0 additions & 67 deletions packages/core/test/utils-hoist/array.test.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/node/src/utils/redisCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ export function calculateCacheItemSize(response: unknown): number | undefined {
: getSize(response);
}

// TODO(v9): This is inlined from core so we can deprecate `flatten`.
// It's usage can be replaced with `Array.flat` in v9.
type NestedArray<T> = Array<NestedArray<T> | T>;

function flatten<T>(input: NestedArray<T>): T[] {
const result: T[] = [];

Expand Down
5 changes: 0 additions & 5 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import {
extractTraceparentData as extractTraceparentData_imported,
filenameIsInApp as filenameIsInApp_imported,
fill as fill_imported,
flatten as flatten_imported,
forEachEnvelopeItem as forEachEnvelopeItem_imported,
generatePropagationContext as generatePropagationContext_imported,
generateSentryTraceHeader as generateSentryTraceHeader_imported,
Expand Down Expand Up @@ -599,10 +598,6 @@ export const isNodeEnv = isNodeEnv_imported;
/** @deprecated Import from `@sentry/core` instead. */
export const loadModule = loadModule_imported;

/** @deprecated Import from `@sentry/core` instead. */
// eslint-disable-next-line deprecation/deprecation
export const flatten = flatten_imported;

/** @deprecated Import from `@sentry/core` instead. */
// eslint-disable-next-line deprecation/deprecation
export const memoBuilder = memoBuilder_imported;
Expand Down

0 comments on commit cb1dcf7

Please sign in to comment.