This commit is contained in:
Benjamin Toby
2025-07-19 07:15:51 +01:00
parent 5a4d4448a5
commit 3cf76f5155
3 changed files with 11 additions and 30 deletions
@@ -23,7 +23,7 @@ function grabParsedValue({ value, tableSchema, encryptionKey, encryptionSalt, da
if (typeof newValue == "undefined")
return;
if (typeof newValue == "object" && !newValue)
newValue = "";
newValue = null;
const htmlRegex = /<[^>]+>/g;
if ((targetFieldSchema === null || targetFieldSchema === void 0 ? void 0 : targetFieldSchema.richText) || String(newValue).match(htmlRegex)) {
newValue = (0, sanitize_html_1.default)(newValue, sanitizeHtmlOptions_1.default);
@@ -50,19 +50,9 @@ function grabParsedValue({ value, tableSchema, encryptionKey, encryptionSalt, da
newValue = "";
}
}
if (typeof newValue === "string" && newValue.match(/^null$/i)) {
newValue = {
toSqlString: function () {
return "NULL";
},
};
}
if (typeof newValue === "string" && !newValue.match(/./i)) {
newValue = {
toSqlString: function () {
return "NULL";
},
};
if (typeof newValue === "string" &&
(newValue.match(/^null$/i) || !newValue.match(/./i))) {
newValue = null;
}
return newValue;
}