Skip to content

Commit

Permalink
Merge branch 'develop' into abhi-remove-makeFifoCache
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad authored Dec 18, 2024
2 parents 68be2db + cb1dcf7 commit 13d3f83
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 142 deletions.
2 changes: 2 additions & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ 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 `makeFifoCache` method 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.

4 changes: 0 additions & 4 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 Expand Up @@ -42,8 +40,6 @@ export {
addContextToFrame,
addExceptionMechanism,
addExceptionTypeValue,
// eslint-disable-next-line deprecation/deprecation
arrayify,
checkOrSetAlreadyCaught,
getEventDescription,
parseSemver,
Expand Down
12 changes: 0 additions & 12 deletions packages/core/src/utils-hoist/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,3 @@ function isAlreadyCaptured(exception: unknown): boolean | void {
return (exception as { __sentry_captured__?: boolean }).__sentry_captured__;
} catch {} // eslint-disable-line no-empty
}

/**
* Checks whether the given input is already an array, and if it isn't, wraps it in one.
*
* @param maybeArray Input to turn into an array, if necessary
* @returns The input, if already an array, or an array with the input as the only element, if not
*
* @deprecated This function has been deprecated and will not be replaced.
*/
export function arrayify<T = unknown>(maybeArray: T | T[]): T[] {
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
}
67 changes: 0 additions & 67 deletions packages/core/test/utils-hoist/array.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/core/test/utils-hoist/misc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Event, Mechanism, StackFrame } from '../../src/types-hoist';
import {
addContextToFrame,
addExceptionMechanism,
arrayify,
checkOrSetAlreadyCaught,
getEventDescription,
uuid4,
Expand Down Expand Up @@ -363,27 +362,3 @@ describe('uuid4 generation', () => {
}
});
});

describe('arrayify()', () => {
it('returns arrays untouched', () => {
// eslint-disable-next-line deprecation/deprecation
expect(arrayify([])).toEqual([]);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify(['dogs', 'are', 'great'])).toEqual(['dogs', 'are', 'great']);
});

it('wraps non-arrays with an array', () => {
// eslint-disable-next-line deprecation/deprecation
expect(arrayify(1231)).toEqual([1231]);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify('dogs are great')).toEqual(['dogs are great']);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify(true)).toEqual([true]);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify({})).toEqual([{}]);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify(null)).toEqual([null]);
// eslint-disable-next-line deprecation/deprecation
expect(arrayify(undefined)).toEqual([undefined]);
});
});
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
10 changes: 0 additions & 10 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
addNormalizedRequestDataToEvent as addNormalizedRequestDataToEvent_imported,
addRequestDataToEvent as addRequestDataToEvent_imported,
applyAggregateErrorsToEvent as applyAggregateErrorsToEvent_imported,
arrayify as arrayify_imported,
baggageHeaderToDynamicSamplingContext as baggageHeaderToDynamicSamplingContext_imported,
basename as basename_imported,
browserPerformanceTimeOrigin as browserPerformanceTimeOrigin_imported,
Expand Down Expand Up @@ -63,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,18 +597,10 @@ 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;

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

/** @deprecated Import from `@sentry/core` instead. */
export const normalizeUrlToBase = normalizeUrlToBase_imported;

Expand Down

0 comments on commit 13d3f83

Please sign in to comment.