index.js
function serialize(type, source, options) {
  var codec = type.codec
  if (!codec)
    return postEncode(new Buffer([ type.byte ]), options)

  var buffer = codec.encode(source, bytewise)

  if (options && options.nested && codec.escape)
    buffer = codec.escape(buffer)

  var hint = typeof codec.length === 'number' ? (codec.length + 1) : void 0 
  var buffers = [ new Buffer([ type.byte ]), buffer ]
  return postEncode(Buffer.concat(buffers, hint), options)
}
function serialize(type, source, options) {
  var codec = type.codec
  if (!codec)
    return postEncode(new Buffer([ type.byte ]), options)

  var buffer = codec.encode(source, bytewise)

  if (options && options.nested && codec.escape)
    buffer = codec.escape(buffer)

  var hint = typeof codec.length === 'number' ? (codec.length + 1) : void 0 
  var buffers = [ new Buffer([ type.byte ]), buffer ]
  return postEncode(Buffer.concat(buffers, hint), options)
}
function serialize ( type , source , options ) { var codec = type . codec if ( ! codec ) return postEncode ( new Buffer ( [ type . byte ] ) , options ) var buffer = codec . encode ( source , bytewise ) if ( options && options . nested && codec . escape ) buffer = codec . escape ( buffer ) var hint = typeof codec . length === 'number' ? ( codec . length + 1 ) : void 0 var buffers = [ new Buffer ( [ type . byte ] ) , buffer ] return postEncode ( Buffer . concat ( buffers , hint ) , options ) }
generate a buffer with type's byte prefix from source value
generate a buffer with type s byte prefix from source value