function cellToBoundary(h3Index, formatAsGeoJson) {
    const cellBoundary = C._malloc(SZ_CELLBOUNDARY);
    const [lower, upper] = h3IndexToSplitLong(h3Index);
    try {
        throwIfError(H3.cellToBoundary(lower, upper, cellBoundary));
        return readCellBoundary(cellBoundary, formatAsGeoJson, formatAsGeoJson);
    } finally {
        C._free(cellBoundary);
    }
}
Get the vertices of a given hexagon (or pentagon), as an array of [lat, lng]
points. For pentagons and hexagons on the edge of an icosahedron face, this
function may return up to 10 vertices.
@static
@param  {H3IndexInput} h3Index          H3 index
@param {boolean} [formatAsGeoJson] Whether to provide GeoJSON output: [lng, lat], closed loops
@return {CoordPair[]}              Array of [lat, lng] pairs
@throws {H3Error}                  If input is invalid