@mastra/rag 2.6.1 → 2.6.2-alpha.0

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.
package/dist/index.js CHANGED
@@ -4016,8 +4016,8 @@ function splitTextWithRegex(text, separator, separatorPosition) {
4016
4016
  if (splits[0]) result.push(splits[0]);
4017
4017
  for (let i = 1; i < splits.length - 1; i += 2) {
4018
4018
  const separator2 = splits[i];
4019
- const text2 = splits[i + 1];
4020
- if (separator2 && text2) result.push(separator2 + text2);
4019
+ const text2 = splits[i + 1] ?? "";
4020
+ if (separator2) result.push(separator2 + text2);
4021
4021
  }
4022
4022
  }
4023
4023
  return result.filter((s) => s !== "");