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")
|
||||
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;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export default function grabParsedValue({
|
||||
: null;
|
||||
|
||||
if (typeof newValue == "undefined") return;
|
||||
if (typeof newValue == "object" && !newValue) newValue = "";
|
||||
if (typeof newValue == "object" && !newValue) newValue = null;
|
||||
|
||||
const htmlRegex = /<[^>]+>/g;
|
||||
|
||||
@ -73,20 +73,11 @@ export default function grabParsedValue({
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "5.0.7",
|
||||
"version": "5.0.8",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user