From 0994a25f8fa4623edc12187c716b0088c6358259 Mon Sep 17 00:00:00 2001 From: Jakub Dobry Date: Tue, 9 Apr 2024 01:04:36 +0200 Subject: [PATCH] Fix missing valuesOptions in fromJSON parser function I've found out that the "valuesOptions" option in the Enum class is missing when parsed from the JSON. This PR should fix the issue: https://github.com/protobufjs/protobuf.js/issues/1961 --- src/enum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enum.js b/src/enum.js index 1c016209f..730b8e4dd 100644 --- a/src/enum.js +++ b/src/enum.js @@ -87,7 +87,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) { * @throws {TypeError} If arguments are invalid */ Enum.fromJSON = function fromJSON(name, json) { - var enm = new Enum(name, json.values, json.options, json.comment, json.comments); + var enm = new Enum(name, json.values, json.options, json.comment, json.comments, json.valuesOptions); enm.reserved = json.reserved; return enm; };