Skip to content
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

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Conversation

KhafraDev
Copy link
Contributor

Fixes #49231

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Mar 26, 2023
@KhafraDev
Copy link
Contributor Author

@microsoft-github-policy-service agree

@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Backlog Bug PRs that fix a backlog bug labels Mar 28, 2023
@@ -88,4 +88,17 @@ declare namespace Intl {
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
};

type EnumerationKeys = "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit";
Copy link
Member

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.

Copy link
Contributor Author

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. 😄

Copy link
Member

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.

@sandersn sandersn self-requested a review April 12, 2023 18:03
Copy link
Member

@sandersn sandersn left a 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.

*
* @param key A string indicating the category of values to return.
*
* @returns {string[]} A list of the supported values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @returns {string[]} A list of the supported values.
* @returns A sorted array of the supported values.

@sandersn
Copy link
Member

Addresses #52956

@sandersn
Copy link
Member

According to the github repo, this is still at stage 3. It should go into esnext, not es2022.

@KhafraDev
Copy link
Contributor Author

KhafraDev commented Apr 12, 2023

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.

@sandersn
Copy link
Member

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.

@sandersn sandersn merged commit fd6f61e into microsoft:main Apr 12, 2023
@KhafraDev KhafraDev deleted the intl-supportedvaluesof branch April 12, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
4 participants