Skip to content

Commit

Permalink
fix(i18n): drop microsecond, nanosecond from unit formatter
Browse files Browse the repository at this point in the history
They are not supported by node 18.
  • Loading branch information
rexxars committed Nov 3, 2023
1 parent 1ca114a commit 61de8dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
40 changes: 18 additions & 22 deletions packages/sanity/src/core/hooks/__tests__/useUnitFormatter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ describe('useUnitFormatter', () => {
'megabit',
'megabyte',
'meter',
'microsecond',
'mile',
'mile-scandinavian',
'milliliter',
'millimeter',
'millisecond',
'minute',
'month',
'nanosecond',
'ounce',
'percent',
'petabyte',
Expand Down Expand Up @@ -144,26 +142,24 @@ describe('useUnitFormatter', () => {
megabit: '22 Mb',
megabyte: '23 MB',
meter: '24 m',
microsecond: '25 μs',
mile: '26 mi',
'mile-scandinavian': '27 smi',
milliliter: '28 mL',
millimeter: '29 mm',
millisecond: '30 ms',
minute: '31 min',
month: '32 mths',
nanosecond: '33 ns',
ounce: '34 oz',
percent: '35%',
petabyte: '36 PB',
pound: '37 lb',
second: '38 sec',
stone: '39 st',
terabit: '40 Tb',
terabyte: '41 TB',
week: '42 wks',
yard: '43 yd',
year: '44 yrs',
mile: '25 mi',
'mile-scandinavian': '26 smi',
milliliter: '27 mL',
millimeter: '28 mm',
millisecond: '29 ms',
minute: '30 min',
month: '31 mths',
ounce: '32 oz',
percent: '33%',
petabyte: '34 PB',
pound: '35 lb',
second: '36 sec',
stone: '37 st',
terabit: '38 Tb',
terabyte: '39 TB',
week: '40 wks',
yard: '41 yd',
year: '42 yrs',
})
})
})
2 changes: 0 additions & 2 deletions packages/sanity/src/core/hooks/useUnitFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ export type FormattableMeasurementUnit =
| 'megabit'
| 'megabyte'
| 'meter'
| 'microsecond'
| 'mile'
| 'mile-scandinavian'
| 'milliliter'
| 'millimeter'
| 'millisecond'
| 'minute'
| 'month'
| 'nanosecond'
| 'ounce'
| 'percent'
| 'petabyte'
Expand Down

0 comments on commit 61de8dd

Please sign in to comment.