mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-14 19:23:26 +08:00
This commit replaces several instances of `.uniq`, `.uniqBy`, and related array deduplication methods with a new utility function `uniqueItemsFromArray`. This change ensures proper deduplication logic across the codebase while addressing the deprecation issues. **Main Changes:** * Created new utility function `uniqueItemsFromArray`: Located in a new file, `array-tools.js`, this function provides a reusable and configurable alternative for deduplication. * Replaced old methods: Updated multiple files to use the new utility function instead of deprecated or custom implementations for deduplication. * Replaced manual deduplication: Replace uses of `[...new Set(array)]` to standardize the deduplication logic across the codebase. * Added unit tests: Introduced thorough test coverage (`array-tools-test.js`) to validate functionality and edge cases for the utility function. * Updated deprecation workflow: Added logging for deprecated uniq and uniqBy methods to the `deprecation-workflow.js`. This change is primarily focused on code quality improvements, ensuring future-proof deduplication, and maintaining alignment with deprecation guidelines. |
||
|---|---|---|
| .. | ||
| admin-dashboard.js | ||
| admin-plugin.js | ||
| admin-user.js | ||
| api-key.js | ||
| backup-status.js | ||
| backup.js | ||
| color-scheme-color.js | ||
| color-scheme.js | ||
| email-log.js | ||
| email-preview.js | ||
| email-settings.js | ||
| email-style.js | ||
| email-template.js | ||
| flag-type.js | ||
| form-template.js | ||
| incoming-email.js | ||
| permalink.js | ||
| report.js | ||
| screened-email.js | ||
| screened-ip-address.js | ||
| screened-url.js | ||
| site-setting.js | ||
| site-text.js | ||
| staff-action-log.js | ||
| theme-settings.js | ||
| theme-site-settings.js | ||
| theme.js | ||
| tl3-requirements.js | ||
| user-export.js | ||
| user-field.js | ||
| version-check.js | ||
| watched-word.js | ||
| web-hook.js | ||