function listEnumValues(enumObject) {
    if (!isEnumObject(enumObject))
        throw new Error("not a typescript enum object");
    let values = [];
    for (let [name, number] of Object.entries(enumObject))
        if (typeof number == "number")
            values.push({ name, number });
    return values;
}
Lists all values of a Typescript enum, as an array of objects with a "name"
property and a "number" property.

Note that it is possible that a number appears more than once, because it is
possible to have aliases in an enum.

Throws if the enum does not adhere to the rules of enums generated by
protobuf-ts. See `isEnumObject()`.