ts-proto 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/main.js +2 -2
- package/package.json +1 -1
package/build/src/main.js
CHANGED
|
@@ -851,7 +851,7 @@ function generateOneofProperty(ctx, messageDesc, oneofIndex, sourceInfo) {
|
|
|
851
851
|
let fieldComments = [];
|
|
852
852
|
(0, utils_1.maybeAddComment)(options, fieldInfo, fieldComments);
|
|
853
853
|
const combinedComments = fieldComments.join("\n");
|
|
854
|
-
return (0, ts_poet_1.code)
|
|
854
|
+
return (0, ts_poet_1.code) `|${combinedComments ? " // " : ""}\n ${combinedComments} { ${mbReadonly}$case: '${fieldName}', ${mbReadonly}${valueName}: ${typeName} }`;
|
|
855
855
|
}));
|
|
856
856
|
const name = (0, case_1.maybeSnakeToCamel)(messageDesc.oneofDecl[oneofIndex].name, options);
|
|
857
857
|
return (0, ts_poet_1.joinCode)([...outerComments, (0, ts_poet_1.code) `${mbReadonly}${name}?:`, unionType, (0, ts_poet_1.code) `| ${(0, utils_1.nullOrUndefined)(options)},`], {
|
|
@@ -1155,7 +1155,7 @@ function generateDecode(ctx, fullName, messageDesc) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
chunks.push((0, ts_poet_1.code) `
|
|
1157
1157
|
const buf = reader.skip(tag & 7);
|
|
1158
|
-
|
|
1158
|
+
|
|
1159
1159
|
${unknownFieldsInitializerSnippet}
|
|
1160
1160
|
const list = message._unknownFields${maybeNonNullAssertion}[tag];
|
|
1161
1161
|
|