Blame view

lib/get-from-body-qs-params.js 278 Bytes
f2c18879a   Adhidarma Hadiwinoto   INQUIRY finished
1
2
3
4
5
6
7
8
9
10
  /**
   * Get value from Express request body, querystring,
   * or params
   * @param  {Object} req
   * @param  {string} keyword
   * @returns {string}
   */
  module.exports = (req, keyword) => (req.body || {})[keyword]
      || (req.query || {})[keyword]
      || (req.params || {})[keyword];