0.1.0 • Published 6 years ago

alias-props v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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

0.1.0

6 years ago