docs: function mapBuilder(map, bufb, codec, width) {
    if (typeof map !== 'object') {
      throw new errors.EncodingError(map, 'Unsure how to encode non-object as map');
    }
  
    if (Array.isArray(map)) {
      throw new errors.EncodingError(map, 'Unsure how to encode array as map');
    }
  
    var keys = Object.keys(map);
    if (!width && keys.length === 0) {
      bufb.appendUInt8(0xC1);
      bufb.appendUInt8(1);
      bufb.appendUInt8(0);
      return;
    }
  
    // Encode all elements into a temp buffer to allow us to front-load appropriate size and count.
    var tempBuilder = new Builder();
    var _len = keys.length;
    for (var _i = 0; _i < _len; ++_i) {
      codec.encode(keys[_i], tempBuilder);
      codec.encode(map[keys[_i]], tempBuilder);
    }
    var tempBuffer = tempBuilder.get();
  
    // Code, size, length, data
    if (width === 1 || (width !== 4 && tempBuffer.length < 0xFF)) {
      // map8
      if (!width) bufb.appendUInt8(0xC1);
      bufb.appendUInt8(tempBuffer.length + 1);
      bufb.appendUInt8(keys.length * 2);
    } else {
      // map32
      if (!width) bufb.appendUInt8(0xD1);
      bufb.appendUInt32BE(tempBuffer.length + 4);
      bufb.appendUInt32BE(keys.length * 2);
    }
  
    bufb.appendBuffer(tempBuffer);
  }