Specify aliases for object properties.
yarn add alias-props
const aliasProps = require('alias-props')
const doSomething = options => {
const {
importantNote = 'Remember buying milk!',
failSilently = false
} = aliasProps(options, {
importantNote: ['cleverComment', 'remarkableRemark'],
failSilently: ['ignoreError']
})
// ...
}
doSomething({ ignoreError: true })
MIT