Skip to content

Conversation

@sapphi-red
Copy link
Contributor

Added es6 export to enum when generating static code from .proto with es6 wrapper.

Example of generated static code

before

$root.Status = (function() {
    const valuesById = {}, values = Object.create(valuesById);
    values[valuesById[0] = "speaking"] = 0;
    values[valuesById[1] = "reviewing"] = 1;
    values[valuesById[2] = "pause"] = 2;
    return values;
})();

after

export const Status = $root.Status = (() => {
    const valuesById = {}, values = Object.create(valuesById);
    values[valuesById[0] = "speaking"] = 0;
    values[valuesById[1] = "reviewing"] = 1;
    values[valuesById[2] = "pause"] = 2;
    return values;
})();
@alexander-fenster alexander-fenster merged commit 9f33784 into protobufjs:master Jul 17, 2020
taylorcode pushed a commit to taylorcode/protobuf.js that referenced this pull request Oct 16, 2020
Co-authored-by: Alexander Fenster <fenster@google.com>
This was referenced May 20, 2022
@github-actions github-actions bot mentioned this pull request Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants