Commit Graph

10 Commits

Author SHA1 Message Date
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
DDDDD12138 63ffd473d5 chore: remove unused imports 2024-09-15 20:17:02 +08:00
lloydzhou 88c74ae18d feat: using fetch to get buildin masks 2024-07-03 14:09:55 +08:00
DeanYao d89a12aa05
Revert "Chat gpt" 2024-05-20 19:02:46 +08:00
Hao Jia 01c9dbc1fd Merge remote-tracking branch 'origin/main' into gpt-4o
# Conflicts:
#	public/apple-touch-icon.png
2024-05-16 14:43:10 +08:00
Peter Dave Hello 1756bdd033 Improve tw Traditional Chinese locale 2024-04-12 00:18:15 +08:00
Yidadaa 8e4743e719 feat: #920 migrate id to nanoid 2023-07-09 19:37:42 +08:00
Yidadaa 1722f75dcb fixup 2023-06-24 00:18:27 +08:00
Yidadaa 50cfbaaab5 feat: partial locale type 2023-05-19 00:59:04 +08:00
Yidadaa c7c58ef031 feat: add i18n for mask 2023-04-27 01:16:21 +08:00