diff --git a/packages/internal/src/netstring.js b/packages/internal/src/netstring.js index 1e938bd35072..326b8228857b 100644 --- a/packages/internal/src/netstring.js +++ b/packages/internal/src/netstring.js @@ -43,10 +43,13 @@ export function netstringEncoderStream() { return new Transform({ transform, writableObjectMode: true }); } -// Input is a Buffer containing zero or more netstrings and maybe some -// leftover bytes. Output is zero or more decoded Buffers, one per netstring, -// plus a Buffer of leftover bytes. -// +/** + * + * @param {Buffer} data containing zero or more netstrings and maybe some + * leftover bytes + * @param {number} [optMaxChunkSize] + * @returns {{ leftover: Buffer, payloads: Buffer[] }} zero or more decoded Buffers, one per netstring, + */ export function decode(data, optMaxChunkSize) { // TODO: it would be more efficient to accumulate pending data in an array, // rather than doing a concat each time