export function getIcosahedronFaces()

in lib/h3core.js [706:722]


export function getIcosahedronFaces(h3Index) {
    const [lower, upper] = h3IndexToSplitLong(h3Index);
    const countPtr = C._malloc(SZ_INT);
    try {
        throwIfError(H3.maxFaceCount(lower, upper, countPtr));
        const count = C.getValue(countPtr, 'i32');
        const faces = C._malloc(SZ_INT * count);
        try {
            throwIfError(H3.getIcosahedronFaces(lower, upper, faces));
            return readArrayOfPositiveIntegers(faces, count);
        } finally {
            C._free(faces);
        }
    } finally {
        C._free(countPtr);
    }
}