You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tha google.protobuf.Any type has a pack and unpack method. If is possible to added them? These are the js definitions.
/**
* Packs the given message instance into this Any.
* For binary format usage only.
* @param {!Uint8Array} serialized The serialized data to pack.
* @param {string} name The type name of this message object.
* @param {string=} opt_typeUrlPrefix the type URL prefix.
*/
proto.google.protobuf.Any.prototype.pack = function(serialized, name,
opt_typeUrlPrefix) {
if (!opt_typeUrlPrefix) {
opt_typeUrlPrefix = 'type.googleapis.com/';
}
if (opt_typeUrlPrefix.substr(-1) != '/') {
this.setTypeUrl(opt_typeUrlPrefix + '/' + name);
} else {
this.setTypeUrl(opt_typeUrlPrefix + name);
}
this.setValue(serialized);
};
/**
* @template T
* Unpacks this Any into the given message object.
* @param {function(Uint8Array):T} deserialize Function that will deserialize
* the binary data properly.
* @param {string} name The expected type name of this message object.
* @return {?T} If the name matched the expected name, returns the deserialized
* object, otherwise returns null.
*/
proto.google.protobuf.Any.prototype.unpack = function(deserialize, name) {
if (this.getTypeName() == name) {
return deserialize(this.getValue_asU8());
} else {
return null;
}
};
The text was updated successfully, but these errors were encountered:
Thanks for this. As you can see the pack and unpack functions just combines the two already existing method. Good to know that this is not a ts issue. Thanks again.
Hi!
Tha google.protobuf.Any type has a pack and unpack method. If is possible to added them? These are the js definitions.
The text was updated successfully, but these errors were encountered: