When you remove duplicates in a collection mapped by keys, you may want to keep track of old keys and their new equivalent.
npm install key-map
const keyMap = require('key-map')
const m = keyMap(['a', 'b', 'c'])
m.get('a') // -> 'a'
m.get('b') // -> 'b'
m.get('c') // -> 'c'
m.map('c', 'b') // map c to b
m.map('b', 'a') // map b to a
m.get('a') // -> 'a'
m.get('b') // -> 'a'
m.get('c') // -> 'a'
If you have a question, found a bug or want to propose a feature, have a look at the issues page.