From c302eb656c9c88f6ae50363c2cc2fd5962ee63ca Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Fri, 13 Oct 2023 16:11:00 +0100 Subject: [PATCH] Document new behavior Signed-off-by: Andrew Haines --- packages/protobuf/src/to-plain-message.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/protobuf/src/to-plain-message.ts b/packages/protobuf/src/to-plain-message.ts index 79c7f7984..f88468369 100644 --- a/packages/protobuf/src/to-plain-message.ts +++ b/packages/protobuf/src/to-plain-message.ts @@ -18,10 +18,13 @@ import { Message } from "./message.js"; import type { AnyMessage, PlainMessage } from "./message.js"; /** - * toPlainMessage returns a new object by striping + * toPlainMessage returns a new object by stripping * all methods from a message, leaving only fields and * oneof groups. It is recursive, meaning it applies this * same logic to all nested message fields as well. + * + * If the argument is already a plain message, it is + * returned as-is. */ export function toPlainMessage>( message: T | PlainMessage,