examples/js/hn/pck.js
function unpckItem(reader) {
  const bitSet0 = pck.readU8(reader);
  const time = pck.readU32(reader);
  const descendants = pck.readUVar(reader);
  const id = pck.readUVar(reader);
  const score = pck.readUVar(reader);
  const by = pck.readUtf8(reader);
  const title = pck.readUtf8(reader);
  const url = (bitSet0 & (1 << 1)) !== 0 ? pck.readUtf8(reader) : "";
  const kids = (bitSet0 & (1 << 0)) !== 0 ? pck.readArray(reader, pck.readUVar) : null;

  return new Item(
    by,
    descendants,
    id,
    kids,
    score,
    time,
    title,
    url,
  );
}
function unpckItem(reader) {
  const bitSet0 = pck.readU8(reader);
  const time = pck.readU32(reader);
  const descendants = pck.readUVar(reader);
  const id = pck.readUVar(reader);
  const score = pck.readUVar(reader);
  const by = pck.readUtf8(reader);
  const title = pck.readUtf8(reader);
  const url = (bitSet0 & (1 << 1)) !== 0 ? pck.readUtf8(reader) : "";
  const kids = (bitSet0 & (1 << 0)) !== 0 ? pck.readArray(reader, pck.readUVar) : null;

  return new Item(
    by,
    descendants,
    id,
    kids,
    score,
    time,
    title,
    url,
  );
}
function unpckItem ( reader ) { const bitSet0 = pck . readU8 ( reader ) ; const time = pck . readU32 ( reader ) ; const descendants = pck . readUVar ( reader ) ; const id = pck . readUVar ( reader ) ; const score = pck . readUVar ( reader ) ; const by = pck . readUtf8 ( reader ) ; const title = pck . readUtf8 ( reader ) ; const url = ( bitSet0 & ( 1 << 1 ) ) !== 0 ? pck . readUtf8 ( reader ) : "" ; const kids = ( bitSet0 & ( 1 << 0 ) ) !== 0 ? pck . readArray ( reader , pck . readUVar ) : null ; return new Item ( by , descendants , id , kids , score , time , title , url , ) ; }
unpckItem is an automatically generated deserialization function.

@param reader Read buffer.
@returns Deserialized object.
unpckItem is an automatically generated deserialization function .