Closed danwt closed 10 months ago
TL; DR: for historical reasons.
The initial goal of this project was copying data from a protobuf struct to some other protobufs struct with a field mask applied. It is also a valid use case to copy from a struct (protobuf) to a map. This is mostly useful for gRPC servers.
Later the copy mechanism was improved to support arbitrary structs (not just protobuf messages), but the set of supported operations stayed the same.
Later on a protobuf specific project was created which supports protobufs only, but in a better way than this project: https://github.com/mennanov/fmutils
Contributions are welcome :)
Why is structToMap supported but not mapToStruct?
Thank you.