How to use the PACKABLE_WIRE_TYPES function from protobufjs

Find comprehensive JavaScript protobufjs.PACKABLE_WIRE_TYPES code examples handpicked from public code repositorys.

23
24
25
26
27
28
29
30
31
32
protobuf.loadProtoFile('protos/Alternate.Signature.proto', builder);

function addPackedOption(ns) {
    if (ns instanceof protobuf.Reflect.Message) {
        ns.getChildren(protobuf.Reflect.Message.Field).forEach(field => {
            if (field.repeated && protobuf.PACKABLE_WIRE_TYPES.indexOf(field.type.wireType) !== -1) {
                field.options.packed = true;
            }
        });
        ns.getChildren(protobuf.Reflect.Message).forEach(addPackedOption);
fork icon1
star icon0
watch icon2