@fachkraftfreund/n8n-nodes-supabase 1.2.23 → 1.2.24
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.
|
@@ -49,6 +49,34 @@ async function executeDatabaseOperation(supabase, operation, itemIndex, hostUrl)
|
|
|
49
49
|
return returnData;
|
|
50
50
|
}
|
|
51
51
|
exports.executeDatabaseOperation = executeDatabaseOperation;
|
|
52
|
+
function sanitizeString(value) {
|
|
53
|
+
return value
|
|
54
|
+
.replace(/\x00/g, '')
|
|
55
|
+
.replace(/\\u[0-9a-fA-F]{4}/g, '')
|
|
56
|
+
.replace(/\\/g, '');
|
|
57
|
+
}
|
|
58
|
+
function sanitizeRow(obj) {
|
|
59
|
+
for (const key of Object.keys(obj)) {
|
|
60
|
+
const val = obj[key];
|
|
61
|
+
if (typeof val === 'string') {
|
|
62
|
+
obj[key] = sanitizeString(val);
|
|
63
|
+
}
|
|
64
|
+
else if (Array.isArray(val)) {
|
|
65
|
+
for (let i = 0; i < val.length; i++) {
|
|
66
|
+
if (typeof val[i] === 'string') {
|
|
67
|
+
val[i] = sanitizeString(val[i]);
|
|
68
|
+
}
|
|
69
|
+
else if (val[i] && typeof val[i] === 'object') {
|
|
70
|
+
sanitizeRow(val[i]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (val && typeof val === 'object') {
|
|
75
|
+
sanitizeRow(val);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
52
80
|
function collectRowData(context, itemCount) {
|
|
53
81
|
const rows = [];
|
|
54
82
|
for (let i = 0; i < itemCount; i++) {
|
|
@@ -72,7 +100,7 @@ function collectRowData(context, itemCount) {
|
|
|
72
100
|
}
|
|
73
101
|
}
|
|
74
102
|
}
|
|
75
|
-
rows.push(row);
|
|
103
|
+
rows.push(sanitizeRow(row));
|
|
76
104
|
}
|
|
77
105
|
return rows;
|
|
78
106
|
}
|
package/package.json
CHANGED