bufbuild / protobuf-es

Protocol Buffers for ECMAScript. The only JavaScript Protobuf library that is fully-compliant with Protobuf conformance tests.
Apache License 2.0
960 stars 55 forks source link

Add initPartialPlain to init plain messages with partials #812

Closed paralin closed 1 month ago

paralin commented 1 month ago

It is possible to run initPartial with a plain message by passing the type separately from the plain message.

This is useful for initializing plain messages with partials.

In the interest of backwards compatibility. the initPartial function signature is kept the same. A separate function called initPartialPlain is added which accepts the type as a third parameter. initPartial is updated to call initPartialPlain with the type from getType() if source is set.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.