"exceptZero" for "signDisplay" option of Intl.NumberFormat() constructor options object #46712
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
Milestone
lib Update Request
In TS 4.4.4
signDisplay
options ofIntl.NumberFormat()
constructor options object used to be of typestring
. See here:TypeScript/src/lib/es2020.intl.d.ts
Line 267 in f633446
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 instantiateIntl.NumberFormat
withsignDisplay
option set to"exceptZero"
.Configuration Check
My compilation target is
ES2015
and my lib isthe default
.Missing / Incorrect Definition
I'm expecting
"exceptZero"
to be a valid value forsignDisplay
option ofIntl.NumberFormat()
constructor options object.Sample Code
Documentation Link
See MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#parameters
See spec: https://402.ecma-international.org/7.0/#sec-getoption
The text was updated successfully, but these errors were encountered: