@ngx-grpc/protoc-gen-ng
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -64,20 +64,25 @@ "use strict"; | ||
function isPacked(proto, field) { | ||
return field.options.packed || proto.syntax === 'proto3' && field.label === types_1.ProtoMessageFieldCardinality.repeated && [ | ||
types_1.ProtoMessageFieldType.int32, | ||
types_1.ProtoMessageFieldType.int64, | ||
types_1.ProtoMessageFieldType.uint32, | ||
types_1.ProtoMessageFieldType.uint64, | ||
types_1.ProtoMessageFieldType.sint32, | ||
types_1.ProtoMessageFieldType.sint64, | ||
types_1.ProtoMessageFieldType.fixed32, | ||
types_1.ProtoMessageFieldType.fixed64, | ||
types_1.ProtoMessageFieldType.sfixed32, | ||
types_1.ProtoMessageFieldType.sfixed64, | ||
types_1.ProtoMessageFieldType.float, | ||
types_1.ProtoMessageFieldType.double, | ||
types_1.ProtoMessageFieldType.bool, | ||
types_1.ProtoMessageFieldType.enum, | ||
].includes(field.type); | ||
var explicitlyPacked = !!field.options.packed; | ||
var implicitlyPacked = proto.syntax === 'proto3' | ||
&& typeof field.options.packed === 'undefined' | ||
&& field.label === types_1.ProtoMessageFieldCardinality.repeated | ||
&& [ | ||
types_1.ProtoMessageFieldType.int32, | ||
types_1.ProtoMessageFieldType.int64, | ||
types_1.ProtoMessageFieldType.uint32, | ||
types_1.ProtoMessageFieldType.uint64, | ||
types_1.ProtoMessageFieldType.sint32, | ||
types_1.ProtoMessageFieldType.sint64, | ||
types_1.ProtoMessageFieldType.fixed32, | ||
types_1.ProtoMessageFieldType.fixed64, | ||
types_1.ProtoMessageFieldType.sfixed32, | ||
types_1.ProtoMessageFieldType.sfixed64, | ||
types_1.ProtoMessageFieldType.float, | ||
types_1.ProtoMessageFieldType.double, | ||
types_1.ProtoMessageFieldType.bool, | ||
types_1.ProtoMessageFieldType.enum, | ||
].includes(field.type); | ||
return explicitlyPacked || implicitlyPacked; | ||
} | ||
exports.isPacked = isPacked; | ||
//# sourceMappingURL=helpers.js.map |
@@ -19,3 +19,3 @@ { | ||
}, | ||
"version": "1.0.3" | ||
"version": "1.0.4" | ||
} |
Sorry, the diff of this file is not supported yet
171425
1788