Files
ChatGPT-Next-Web/app
Lincoln Minto 83e6ff6d96 Refactor: Simplify mask data processing using Object.values and flat
💻 变更类型 | Change Type
feat

🔀 变更说明 | Description of Change
This PR refactors the code handling mask data processing by simplifying the logic and improving scalability and type safety.

Code Enhancements:
Refactored the mask processing logic in app/masks/index.ts:
Replaced manual destructuring of cn, tw, and en keys with Object.values to dynamically handle all mask data.
Used .flat() to simplify merging mask arrays into a single collection.
Added explicit type casting (as BuiltinMask) for improved type safety.

Benefits:
Improved Maintainability: By eliminating hardcoded destructuring, the code can adapt automatically to new mask keys without modification.
Enhanced Readability: The use of Object.values and flat provides a cleaner, more concise approach.
Scalability: The updated implementation supports dynamic mask additions without breaking functionality.

📝 补充信息 | Additional Information
This change ensures the mask processing code is robust and easier to extend in future updates.

Release Notes:

New Features:
Simplified mask data processing using dynamic Object.values and .flat() methods.
Enhanced type safety with explicit type casting (as BuiltinMask).
2025-01-07 09:53:54 -03:00
..
2024-12-29 11:24:57 +08:00
2024-12-31 14:50:54 +08:00
2024-11-11 13:15:09 +08:00
2024-11-08 13:21:40 +08:00
2024-12-30 09:13:12 +00:00
2024-08-21 10:28:34 +08:00
2024-12-28 17:54:21 +08:00
2024-09-14 14:19:11 +08:00
2024-10-11 11:29:22 +08:00
2024-09-18 10:39:56 +08:00
2024-12-28 20:23:44 +08:00