@alexein/n8n-nodes-alexein 0.3.1 → 0.3.2
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.
|
@@ -182,6 +182,7 @@ function merged(operation, pages) {
|
|
|
182
182
|
const all = pages.flatMap((p) => (Array.isArray(p[key]) ? p[key] : []));
|
|
183
183
|
return { ...pages[0], [key]: all, next: null };
|
|
184
184
|
}
|
|
185
|
+
const BREAK = /\s*[\r\n]\s*/g;
|
|
185
186
|
function context(answer, maxChars) {
|
|
186
187
|
var _a;
|
|
187
188
|
const memories = Array.isArray(answer.memories) ? answer.memories : [];
|
|
@@ -190,7 +191,10 @@ function context(answer, maxChars) {
|
|
|
190
191
|
let out = '';
|
|
191
192
|
for (const memory of memories) {
|
|
192
193
|
const date = memory.type === 'excerpt' && memory.date ? String(memory.date).slice(0, 10) : '';
|
|
193
|
-
const
|
|
194
|
+
const text = String((_a = memory.text) !== null && _a !== void 0 ? _a : '')
|
|
195
|
+
.trim()
|
|
196
|
+
.replace(BREAK, ' ');
|
|
197
|
+
const line = `- ${date ? `${date}: ` : ''}${text}`;
|
|
194
198
|
const grown = `${out || head}${out ? '\n' : ''}${line}`;
|
|
195
199
|
if (grown.length > maxChars)
|
|
196
200
|
break;
|
package/package.json
CHANGED