♻️ refactor(utils): optimize resetPricingFilters function for better maintainability (#1365)
- Extract default values to DEFAULT_PRICING_FILTERS constant for centralized configuration - Replace verbose type checks with optional chaining operator (?.) for cleaner code - Eliminate redundant function type validations and comments - Reduce code lines by ~50% (from 60 to 25 lines) while maintaining full functionality - Improve code readability and follow modern JavaScript best practices This refactoring enhances code quality without changing the function's behavior, making it easier to maintain and modify default filter values in the future.
This commit is contained in:
@@ -577,7 +577,7 @@ export const calculateModelPrice = ({
|
||||
tokenUnit,
|
||||
displayPrice,
|
||||
currency,
|
||||
precision = 3
|
||||
precision = 4
|
||||
}) => {
|
||||
if (record.quota_type === 0) {
|
||||
// 按量计费
|
||||
|
||||
Reference in New Issue
Block a user