Skip to content

Commit

Permalink
fix: ensure that NumberFormat.formatToParts is available
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Jul 27, 2020
1 parent bf466fd commit f4121a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export function resolveFormatFactory<T extends Args>(
getOptions: GetOptions<T>,
) {
return (locales?: Locale | Locale[], ...args: T): Format | null => {
if (!isIntlSupported) {
if (
!isIntlSupported ||
typeof Intl.NumberFormat.prototype.formatToParts === 'undefined'
) {
return null;
}

Expand Down

0 comments on commit f4121a2

Please sign in to comment.