alias-props
v0.1.0
Published
Specify aliases for object properties.
Downloads
3
Readme
alias-props
Specify aliases for object properties.
Installation
yarn add alias-props
Usage
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 })
License
MIT