-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Intl.supportedValuesOf #53511
add Intl.supportedValuesOf #53511
Conversation
@microsoft-github-policy-service agree |
src/lib/es2022.intl.d.ts
Outdated
@@ -88,4 +88,17 @@ declare namespace Intl { | |||
*/ | |||
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[]; | |||
}; | |||
|
|||
type EnumerationKeys = "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we should be defining a type alias for this - especially one as broadly named as EnumerationKeys
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could inline it or just make it a string if preferred, but the proposal that added it is called Intl enumeration so I thought the name was fitting. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think for now let's inline it if that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to get this into 5.1, so I'll address the requests myself and push a commit.
src/lib/es2022.intl.d.ts
Outdated
* | ||
* @param key A string indicating the category of values to return. | ||
* | ||
* @returns {string[]} A list of the supported values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns {string[]} A list of the supported values. | |
* @returns A sorted array of the supported values. |
Addresses #52956 |
According to the github repo, this is still at stage 3. It should go into esnext, not es2022. |
However it's marked as stage 4 in the main tc39 repo: https://github.com/tc39/proposals/blob/faa00dc13c48463a02dfe3aa6387b7082b41ce27/ecma402/finished-proposals.md Sorry for the delays btw, haven't had much free time. |
Thanks for the pointer. I'll put it back in 2022. And thanks for your contribution, no worries about timing. I don't normally take over recent PRs, but this one only needs small changes and the beta ships on Friday. |
This reverts commit 4857386.
Fixes #49231