Conversation
Added test cases for the same
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for part options with the n function, allowing it to return detailed number formatting parts. Key changes include adding new test cases to verify part formatting, updating type assertions in the tests, and modifying the n function’s return type in the composer module.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/vue-i18n-core/test/composer.test.ts | Added new test case “part formating with n” to verify number part formatting support |
| packages/vue-i18n-core/test/composer.test-d.ts | Updated type assertions for the n function’s return type to support part formatting |
| packages/vue-i18n-core/src/composer.ts | Changed the n function’s return type from string to string |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Size ReportBundles
Usages
|
@intlify/core
@intlify/core-base
@intlify/devtools-types
@intlify/message-compiler
petite-vue-i18n
@intlify/shared
vue-i18n
@intlify/vue-i18n-core
commit: |
|
The below comments are our notes:
|
|
@mauryapari If you can improve the type of my comments, please take up the challenge. If you can't, I will have someone else work on it as a separate issue. |
There was a problem hiding this comment.
If n ($n) will pass the NumberOptions, n ($n) would be a good, inferred return type,
such as, pass string or Intl.NumberFormatPart[] to type parameter and the return type of it, or automatically infer from NumberOptions
vue-i18n/packages/vue-i18n/src/vue.d.ts
Line 849 in 2e04bed
There was a problem hiding this comment.
I am new to Typescript and have tried to add the change you requested. Please have a look.
Do let me know if I might have missed something. I'll work on that.
Thanks
By improving the type of comments, do you mean should I add some details to the below new issues you opened?
Sorry if I misunderstood. Could you please clarify? |
Sorry, my poor explanation. That meas is type improvement of this PR. |
|
Okay Got it. Thanks. I have added type improvement as you asked. Do let me know if that is fine. :) |
|
Thanks! LGTM! |
partoption fornfails with an error #1165