Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core)!: Remove flatten method #14784

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading