docs: function castBuffer (val) {
    if (Buffer.isBuffer(val)) {
      return val
    }
  
    val = toJSON(val)
    var args = assertArgs([val], {
      val: ['string', 'array', 'object', 'number', 'boolean']
    })
    val = args.val
  
    var str
  
    if (Array.isArray(val)) {
      val = val.map(toJSON)
      str = JSON.stringify(val)
    } else if (isObject(val)) {
      val = toJSON(val)
      str = JSON.stringify(val)
    } else { // val is a string, number, or boolean
      str = val + ''
    }
  
    return new Buffer(str)
  }