refactor(fileSize): optimize asset sorting and display logic#6709
refactor(fileSize): optimize asset sorting and display logic#6709chenjiahan merged 5 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the fileSize plugin to improve type safety and code organization. The main improvements include introducing a FormattedAsset type for better type definitions, extracting utility functions (calcTotalSize, pickAssetInfo) for better modularity, and renaming normalizeFileName to normalizeFilename for consistency.
Key Changes:
- Added
FormattedAssettype to formalize the structure of formatted asset data - Extracted total size calculation logic into a reusable
calcTotalSizefunction - Renamed exported function
normalizeFileNametonormalizeFilenamefor naming consistency - Optimized asset sorting by moving it inside the
getAssetsfunction - Pre-computed filename labels and lengths in
formatAssetfor better performance
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
FormattedAssettype for better type safetyChecklist