mapbox / pbf

A low-level, lightweight protocol buffers implementation in JavaScript.
BSD 3-Clause "New" or "Revised" License
796 stars 106 forks source link

Remove one tag #133

Closed IgorRSGraziano closed 2 months ago

IgorRSGraziano commented 4 months ago

I'm editing an external protobuf, where I don't have a mapping file, but I know I need to edit the item with tag 1. But if I write the tag, it gets duplicated, how can I remove one?

proto.writeStringField(1, preparedMsg)

After write one field, if i run

proto.readFields((tag, _, pbf) => { if (tag != 1 || !pbf) return; console.log(tag); });

i get twice log of 1

mourner commented 2 months ago

You'd have to rebuild the whole pbf from scratch. There's no "editing in place" in Protobuf.