discourse/plugins/discourse-local-dates/assets/javascripts/lib
Sérgio Saquetim 0c4f285618
DEV: Replace deprecated Ember's array uniq and uniqBy (#35227)
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.
2025-10-13 16:47:36 -03:00
..
discourse-markdown FEATURE: allow customizing default timezone for email. (#32964) 2025-05-29 14:17:37 +10:00
date-with-zone-helper.js DEV: Update JS class sorting to match new lint rule 2022-08-15 09:28:31 +01:00
local-date-builder.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
local-date-markup-generator.js FIX: Quoting local dates bbcode regeneration (#17141) 2022-06-21 10:07:21 +10:00
rich-editor-extension.js UX: prosemirror rich editor nodes cleanup / slightly better UX (#32361) 2025-04-18 00:20:55 -03:00