Updates
This commit is contained in:
parent
5a4d4448a5
commit
3cf76f5155
@ -23,7 +23,7 @@ function grabParsedValue({ value, tableSchema, encryptionKey, encryptionSalt, da
|
|||||||
if (typeof newValue == "undefined")
|
if (typeof newValue == "undefined")
|
||||||
return;
|
return;
|
||||||
if (typeof newValue == "object" && !newValue)
|
if (typeof newValue == "object" && !newValue)
|
||||||
newValue = "";
|
newValue = null;
|
||||||
const htmlRegex = /<[^>]+>/g;
|
const htmlRegex = /<[^>]+>/g;
|
||||||
if ((targetFieldSchema === null || targetFieldSchema === void 0 ? void 0 : targetFieldSchema.richText) || String(newValue).match(htmlRegex)) {
|
if ((targetFieldSchema === null || targetFieldSchema === void 0 ? void 0 : targetFieldSchema.richText) || String(newValue).match(htmlRegex)) {
|
||||||
newValue = (0, sanitize_html_1.default)(newValue, sanitizeHtmlOptions_1.default);
|
newValue = (0, sanitize_html_1.default)(newValue, sanitizeHtmlOptions_1.default);
|
||||||
@ -50,19 +50,9 @@ function grabParsedValue({ value, tableSchema, encryptionKey, encryptionSalt, da
|
|||||||
newValue = "";
|
newValue = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof newValue === "string" && newValue.match(/^null$/i)) {
|
if (typeof newValue === "string" &&
|
||||||
newValue = {
|
(newValue.match(/^null$/i) || !newValue.match(/./i))) {
|
||||||
toSqlString: function () {
|
newValue = null;
|
||||||
return "NULL";
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (typeof newValue === "string" && !newValue.match(/./i)) {
|
|
||||||
newValue = {
|
|
||||||
toSqlString: function () {
|
|
||||||
return "NULL";
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ export default function grabParsedValue({
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (typeof newValue == "undefined") return;
|
if (typeof newValue == "undefined") return;
|
||||||
if (typeof newValue == "object" && !newValue) newValue = "";
|
if (typeof newValue == "object" && !newValue) newValue = null;
|
||||||
|
|
||||||
const htmlRegex = /<[^>]+>/g;
|
const htmlRegex = /<[^>]+>/g;
|
||||||
|
|
||||||
@ -73,20 +73,11 @@ export default function grabParsedValue({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof newValue === "string" && newValue.match(/^null$/i)) {
|
if (
|
||||||
newValue = {
|
typeof newValue === "string" &&
|
||||||
toSqlString: function () {
|
(newValue.match(/^null$/i) || !newValue.match(/./i))
|
||||||
return "NULL";
|
) {
|
||||||
},
|
newValue = null;
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof newValue === "string" && !newValue.match(/./i)) {
|
|
||||||
newValue = {
|
|
||||||
toSqlString: function () {
|
|
||||||
return "NULL";
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return newValue;
|
return newValue;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "5.0.7",
|
"version": "5.0.8",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
Reference in New Issue
Block a user