This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
Automatically Filter out duplicate expansions #3720
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed some duplicate expansions and thought that an automated process should be able to prevent that.
Modified the buid.js file, added an extra filter function, that takes the current expansion (e), the current expansions index (idx) and finally the current expansion list that has already been filtered twice (currentList).
In the filter it checks if there is a next item in the expansion list, if there is it compares the next expansion with the current expansion using toLowerCase and returns false if they match, which excludes the current expansion from the list but includes the next expansion. If there is no next line it returns true allowing the current expansion into the filtered list.
References
Related to #2794 #3656 #3381 #2824 #3265 #3266 #2255 #3266 #3265 #2888 #2577 #2468, #2367, #2356, #2255, #2201, #2115, #1956,