log.js 219 B

123456
  1. const log = o => {
  2. if (typeof o !== 'object') throw new Error('log message should be an object')
  3. if (!o.type) throw new Error('log message should have a type')
  4. console.log(JSON.stringify(o))
  5. }
  6. module.exports = log