Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: es6 export enum #1446

Merged
merged 2 commits into from Jul 17, 2020
Merged

fix: es6 export enum #1446

merged 2 commits into from Jul 17, 2020

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants