function compactCells(h3Set) {
    if (!h3Set || !h3Set.length) {
        return [];
    }
    // Set up input set
    const count = h3Set.length;
    const set = C._calloc(count, SZ_H3INDEX);
    storeArrayOfH3Indexes(set, h3Set);
    // Allocate memory for compacted hexagons, worst-case is no compaction
    const compactedSet = C._calloc(count, SZ_H3INDEX);
    try {
        throwIfError(H3.compactCells(set, compactedSet, count, UNUSED_UPPER_32_BITS));
        return readArrayOfH3Indexes(compactedSet, count);
    } finally {
        C._free(set);
        C._free(compactedSet);
    }
}
Compact a set of hexagons of the same resolution into a set of hexagons across
multiple levels that represents the same area.
@static
@param  {H3IndexInput[]} h3Set H3 indexes to compact
@return {H3Index[]}       Compacted H3 indexes
@throws {H3Error}         If the input is invalid (e.g. duplicate hexagons)