lib/pack-codec.js
function emitObject() {
    var body = bodec.join(parts);
    if (body.length !== length) {
      throw new Error("Body length mismatch");
    }
    var item = {
      type: numToType[type],
      size: length,
      body: body,
      offset: start
    };
    if (ref) item.ref = ref;
    parts.length = 0;
    start = 0;
    offset = 0;
    type = 0;
    length = 0;
    ref = null;
    emit(item);
  }
function emitObject() {
    var body = bodec.join(parts);
    if (body.length !== length) {
      throw new Error("Body length mismatch");
    }
    var item = {
      type: numToType[type],
      size: length,
      body: body,
      offset: start
    };
    if (ref) item.ref = ref;
    parts.length = 0;
    start = 0;
    offset = 0;
    type = 0;
    length = 0;
    ref = null;
    emit(item);
  }
Common helper for emitting all three object shapes