@bobfrankston/rmfmail 1.1.25 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7596,17 +7596,18 @@ var NativeImapClient = class {
7596
7596
  items.push("BODY.PEEK[]");
7597
7597
  const tag = nextTag();
7598
7598
  const streamed = [];
7599
- const cb = onMessage ? (resp) => {
7599
+ const cb = (resp) => {
7600
7600
  if (resp.tag !== "*" || resp.type !== "FETCH")
7601
7601
  return;
7602
7602
  const parsed = this.parseFetchResponses([resp]);
7603
7603
  for (const msg of parsed) {
7604
7604
  streamed.push(msg);
7605
- onMessage(msg);
7605
+ if (onMessage)
7606
+ onMessage(msg);
7606
7607
  }
7607
- } : void 0;
7608
- const responses = await this.sendCommand(tag, fetchCommand(tag, range, items), cb);
7609
- return onMessage ? streamed : this.parseFetchResponses(responses);
7608
+ };
7609
+ await this.sendCommand(tag, fetchCommand(tag, range, items), cb);
7610
+ return streamed;
7610
7611
  }
7611
7612
  /**
7612
7613
  * Folder-scoped batch body fetch. Selects `folderPath`, issues a single