-
Notifications
You must be signed in to change notification settings - Fork 75
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
refactor: size unit convert functions #2859
refactor: size unit convert functions #2859
Conversation
Your org requires the Graphite merge queue for merging into mainAdd the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 5.38% (+0.12% 🔼) |
395/7342 |
🔴 | Branches | 4.67% (+0.14% 🔼) |
237/5077 |
🔴 | Functions | 3.22% (+0.08% 🔼) |
78/2420 |
🔴 | Lines | 5.29% (+0.12% 🔼) |
380/7182 |
Test suite run success
124 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from f67ec31
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.
LGTM
Merge activity
|
Refactors binary and decimal size unit conversion functions This PR renames `iSizeToSize` to `convertBinarySizeUnit` and adds a new `convertDecimalSizeUnit` function to clearly distinguish between binary (1024-based) and decimal (1000-based) size unit conversions. The changes improve code readability and maintainability by: - Renaming `iSizeToSize` to the more descriptive `convertBinarySizeUnit` - Adding `convertDecimalSizeUnit` for 1000-based conversions - Introducing a shared internal `convertSizeUnit` function - Adding comprehensive unit tests for both conversion methods - Adding support for automatic unit selection with 'auto' parameter - Adding proper TypeScript exports for size unit types **Checklist:** - [ ] Test cases added to demonstrate binary vs decimal conversions - [ ] Unit tests verify correct handling of edge cases and automatic unit selection - [ ] All existing functionality maintained with renamed function
3323020
to
f67ec31
Compare
Refactors binary and decimal size unit conversion functions
This PR renames
iSizeToSize
toconvertBinarySizeUnit
and adds a newconvertDecimalSizeUnit
function to clearly distinguish between binary (1024-based) and decimal (1000-based) size unit conversions. The changes improve code readability and maintainability by:iSizeToSize
to the more descriptiveconvertBinarySizeUnit
convertDecimalSizeUnit
for 1000-based conversionsconvertSizeUnit
functionChecklist: