badmfck-api-server 3.6.3 → 3.6.4
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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
|
|
95
95
|
exports.Initializer = Initializer;
|
96
96
|
class APIService extends BaseService_1.BaseService {
|
97
97
|
static nextLogID = 0;
|
98
|
-
version = "3.6.
|
98
|
+
version = "3.6.4";
|
99
99
|
options;
|
100
100
|
monitor = null;
|
101
101
|
started = new Date();
|
@@ -472,8 +472,18 @@ class MysqlAdapter {
|
|
472
472
|
let system = field.system;
|
473
473
|
if (value === null || value === undefined)
|
474
474
|
return "NULL";
|
475
|
-
if (!system && typeof value === "
|
476
|
-
|
475
|
+
if (!system && typeof value === "object") {
|
476
|
+
try {
|
477
|
+
value = JSON.stringify(value);
|
478
|
+
}
|
479
|
+
catch (e) {
|
480
|
+
console.error("Can't prepare JSON object", e);
|
481
|
+
value = "{}";
|
482
|
+
}
|
483
|
+
}
|
484
|
+
if (!system && typeof value === "string") {
|
485
|
+
value = promise_1.default.escape(value);
|
486
|
+
}
|
477
487
|
if (typeof value === "boolean")
|
478
488
|
value = value ? 1 : 0;
|
479
489
|
field.__parsedValue = value;
|