function edgeLength(edge, unit) {
    const [lower, upper] = h3IndexToSplitLong(edge);
    const out = C._malloc(SZ_DBL);
    try {
        switch (unit) {
            case UNITS.m:
                throwIfError(H3.edgeLengthM(lower, upper, out));
                break;
            case UNITS.km:
                throwIfError(H3.edgeLengthKm(lower, upper, out));
                break;
            case UNITS.rads:
                throwIfError(H3.edgeLengthRads(lower, upper, out));
                break;
            default:
                throw JSBindingError(E_UNKNOWN_UNIT, unit);
        }
        return readDoubleFromPointer(out);
    } finally {
        C._free(out);
    }
}
Calculate length of a given unidirectional edge
@static
@param  {H3IndexInput} edge     H3 index of the edge to measure
@param  {string}  unit     Distance unit (either UNITS.m, UNITS.km, or UNITS.rads)
@return {number}           Cell area
@throws {H3Error}          If the input is invalid