Comparing version 1.175.0 to 1.175.1
@@ -191,3 +191,15 @@ "use strict"; | ||
const extension = extensionCache[extendee][parseInt(key, 10) >>> 3]; | ||
resultOptions.push(getExtensionValue(ctx, extension, value)); | ||
if (shouldAddOptionDefinition(ctx, extension)) { | ||
// todo: we should be able to create an option definition ALWAYS, however, | ||
// we currently cannot do that because the if the extension is a sub-message | ||
// (and thus, not just a straightforward value), we don't have an JSON object | ||
// representation of the option - just it's encoded value. Our approach in | ||
// getExtensionValue is to decode the encoded value into a message, but this | ||
// Message.decode(...) method is not always included in the generated code. | ||
// We should fix this so that we can always create an option definition by | ||
// somehow premptively decoding the encoded value and then inserting it into | ||
// the option defintion. | ||
// please refer to inteegration/options-types-only to see this in action | ||
resultOptions.push(getExtensionValue(ctx, extension, value)); | ||
} | ||
} | ||
@@ -199,2 +211,7 @@ if (resultOptions.length == 0) { | ||
} | ||
function shouldAddOptionDefinition(ctx, extension) { | ||
return (extension.type !== ts_proto_descriptors_1.FieldDescriptorProto_Type.TYPE_MESSAGE || | ||
ctx.options.outputEncodeMethods === true || | ||
ctx.options.outputEncodeMethods == "decode-only"); | ||
} | ||
function resolveMessageOptions(ctx, message) { | ||
@@ -201,0 +218,0 @@ const fieldsOptions = []; |
{ | ||
"name": "ts-proto", | ||
"version": "1.175.0", | ||
"version": "1.175.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/plugin.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395473
6835