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

@sapphi-red sapphi-red commented Jul 15, 2020

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
9 checks passed
Loading
taylorcode added a commit to taylorcode/protobuf.js that referenced this issue Oct 16, 2020
Co-authored-by: Alexander Fenster <fenster@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants