You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"exceptZero" for "signDisplay" option of Intl.NumberFormat() constructor options object #46712
That was changed in this PR: #45647. Now it's of type "auto" | "never" | "always" | undefined. However, I believe this type union is incomplete and should also include "exceptZero" (see MDN and spec links below). As a result starting from TS 4.5.0-beta (or possibly earlier, I didn't test versions between 4.4.4 and 4.5.0-beta) you now get an error if you try to instantiate Intl.NumberFormat with signDisplay option set to "exceptZero".
Configuration Check
My compilation target is ES2015 and my lib is the default.
Missing / Incorrect Definition
I'm expecting "exceptZero" to be a valid value for signDisplay option of Intl.NumberFormat() constructor options object.
Sample Code
constnumberFormatter=newIntl.NumberFormat('en',{signDisplay: 'exceptZero'// expect `exceptZero` to be a valid value but it's not according to type definitions});
I've updated Typescript to 4.5.5 but I'm still having the aforementioned issue. Has the fix been applied?
Reacted by jorbuedo, Umar Bolatov, Sebastiaan, Eemeli Aro, Maurice Reichelt, Peter Sciranka, y.takahashi, Marcos Mercuri, Kritsada Sunthornwutthikrai, Arthur Pastel and 2 more
Activity
iAziz786 commentedon Nov 9, 2021
I would like to pick this issue.
iAziz786 commentedon Nov 9, 2021
I assume adding the missing type in the union will do the work?
bolatovumar commentedon Nov 10, 2021
Mohammad Aziz (@iAziz786) yeah, that's correct.
iAziz786 commentedon Nov 11, 2021
Cool, Daniel Rosenwasser (@DanielRosenwasser) may I request for the PR to review by anyone?
ArthurGuez commentedon Jan 27, 2022
Hi there,
I've updated Typescript to 4.5.5 but I'm still having the aforementioned issue. Has the fix been applied?
refactor(number-skeleton): Use Intl.NumberFormatOptions defined in TS…
refactor(number-skeleton): Use Intl.NumberFormatOptions defined in TS…