Skip to content

Commit

Permalink
Remove deprecated exports (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Aug 14, 2024
1 parent 6b8dc64 commit 53a8574
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-years-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/intl': major
---

Removed the deprecated `format`, `formatToParts`, `resolveFormat`, and `isIntlSupported` exports. Use the explicitly named `formatNumber`, `formatNumberToParts`, `resolveNumberFormat`, and `isNumberFormatSupported` exports instead.
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@
*/

export {
format,
formatNumber,
formatCurrency,
formatToParts,
formatNumberToParts,
formatCurrencyToParts,
resolveFormat,
resolveNumberFormat,
resolveCurrencyFormat,
isNumberFormatSupported,
isNumberFormatToPartsSupported,
isIntlSupported,
} from './lib/number-format';
export {
formatDate,
Expand Down
25 changes: 1 addition & 24 deletions src/lib/number-format/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,14 @@ import type {
import { findIndex } from '../find-index';

import {
isIntlSupported,
isNumberFormatSupported,
isNumberFormatToPartsSupported,
getNumberFormat,
} from './intl';
import { getNumberOptions } from './numbers';
import { getCurrencyOptions } from './currencies';

export {
isIntlSupported,
isNumberFormatSupported,
isNumberFormatToPartsSupported,
};
export { isNumberFormatSupported, isNumberFormatToPartsSupported };

type GetOptions = (
locales: Locale | Locale[],
Expand Down Expand Up @@ -70,12 +65,6 @@ export const formatNumber = formatNumberFactory(getNumberOptions) as (
options?: Intl.NumberFormatOptions,
) => string;

/**
* @deprecated Use {@link formatNumber} instead.
* @hidden
*/
export const format = formatNumber;

/**
* Formats a number in the country's official currency
* with support for various [notations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat#Using_notation).
Expand Down Expand Up @@ -167,12 +156,6 @@ export const formatNumberToParts = formatNumberToPartsFactory(
options?: Intl.NumberFormatOptions,
) => Intl.NumberFormatPart[];

/**
* @deprecated Use {@link formatNumberToParts} instead.
* @hidden
*/
export const formatToParts = formatNumberToParts;

/* eslint-disable no-irregular-whitespace */
/**
* Formats a number in the country's official currency
Expand Down Expand Up @@ -312,12 +295,6 @@ export const resolveNumberFormat = resolveNumberFormatFactory(
options?: Intl.NumberFormatOptions,
) => NumberFormat | null;

/**
* @deprecated Use {@link resolveNumberFormat} instead.
* @hidden
*/
export const resolveFormat = resolveNumberFormat;

/**
* Resolves the locale and collation options that are used to format a number
* in the country's official currency.
Expand Down
6 changes: 0 additions & 6 deletions src/lib/number-format/intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ export const isNumberFormatToPartsSupported = (() => {
}
})();

/**
* @deprecated Use {@link isNumberFormatSupported} instead.
* @hidden
*/
export const isIntlSupported = isNumberFormatSupported;

export const getNumberFormat = memoizeFormatConstructor(Intl.NumberFormat) as (
locales?: Locale | Locale[],
options?: Intl.NumberFormatOptions,
Expand Down

0 comments on commit 53a8574

Please sign in to comment.