You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deduplication offset when some imports are disabled #505
See input and output of getImports(); duplicates are not correctly deduplicated.
Describe the bug
The dedupeImports function manages a Set of imports array indexes that need to be removed (deduplicated). However, imports is first filtered to remove disabled imports, which could cause an offset of collected indexes from the original imports array.
the index 1 should be removed, but since the filtered array does not have the disabled import, index 0 will be marked for removal, which ultimately causes the disabled import to be removed instead of the duplicated import.
I am planning to submit a PR to fix this.
Additional context
No response
Logs
Duplicated imports "foo", the one from "anywhere.js" has been ignored and "elsewhere.js" is used
[
{ name: 'foo', from: 'somewhere.js', as: 'foo' },
{ name: 'foo', from: 'elsewhere.js', as: 'foo' }
]
Activity
fix(dedupeImports): use original array index to avoid offset with dis…