Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add approximatelySign to NumberFormatPartTypeRegistry for ES2023#62013

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-61960

Conversation

Copilot
Copy link
Contributor

@CopilotCopilotAI commentedJul 7, 2025
edited
Loading

TheNumberFormatPartTypeRegistry interface was missing theapproximatelySign part type, which is used byIntl.NumberFormat.formatRangeToParts() when ranges round to approximately the same value.

This caused TypeScript compilation errors when filtering format parts:

constnf=newIntl.NumberFormat("en-US",{style:"currency",currency:"EUR",maximumFractionDigits:0,});// This would fail with TS error before the fixnf.formatRangeToParts(value.from,value.to).filter((part)=>part.type!=="approximatelySign").map((part)=>part.value).join("");

Changes:

  • AddedapproximatelySign: never; toNumberFormatPartTypeRegistry interface insrc/lib/es2023.intl.d.ts
  • Updated ES2023 intl test to include validation of the new part type
  • Updated test baselines to reflect the change

The change follows the existing pattern used across ES versions for extending theNumberFormatPartTypeRegistry with new part types, ensuring TypeScript properly recognizesapproximatelySign as a valid format part type.

Fixes#61960.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

@typescript-bottypescript-bot added the For Milestone BugPRs that fix a bug with a specific milestone labelJul 7, 2025
CopilotAIand others added2 commitsJuly 7, 2025 19:09
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
@CopilotCopilotAI changed the title[WIP] NumberFormatPartTypeRegistry doesn't have approximatelySign in itAdd approximatelySign to NumberFormatPartTypeRegistry for ES2023Jul 7, 2025
@CopilotCopilotAI requested a review fromRyanCavanaughJuly 7, 2025 19:27
Copilot finished work on behalf ofRyanCavanaughJuly 7, 2025 19:27
Copy link
Contributor

@Renegade334Renegade334 left a comment

Choose a reason for hiding this comment

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

approximatelySign is a range-only type – in an ideal world, a separateNumberFormatRangePartTypeRegistry extends NumberFormatPartTypeRegistry interface would be the proper place for this.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Renegade334Renegade334Renegade334 left review comments

@RyanCavanaughRyanCavanaughAwaiting requested review from RyanCavanaugh

At least 1 approving review is required to merge this pull request.

Labels
For Milestone BugPRs that fix a bug with a specific milestone
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

NumberFormatPartTypeRegistry doesn't have approximatelySign in it
4 participants
@Copilot@Renegade334@RyanCavanaugh@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp