unpackAnyfunction
Read a packed file whether or not it is gzipped (gzip is found from its first two bytes). The unpacked size is capped at MAX_PACKED_BYTES, so a small file that unpacks to a huge one is refused.
Import it
import { unpackAny } from "@johnmorrisdotca/chikyu-earth/catalogue";
Definition
function unpackAny(bytes: Uint8Array): Promise<PackedCatalogue>
Parameters
| Name | Type | Description |
|---|---|---|
bytes | Uint8Array<ArrayBufferLike> | A packed file, or a gzipped one. |
Returns
Promise<PackedCatalogue>
The records, by column.
Examples
import { gzipBytes, packCatalogue, unpackAny } from "@johnmorrisdotca/chikyu-earth/catalogue";
const file = await unpackAny(await gzipBytes(packCatalogue([], { group: "empty" })));
console.log(file.count, file.meta["group"]);0 emptyWhat it prints (run when this page was built)