@morghulis/core 1.0.56 → 1.0.57
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.
|
@@ -6989,7 +6989,7 @@ class cr {
|
|
|
6989
6989
|
}
|
|
6990
6990
|
parse(t) {
|
|
6991
6991
|
const { domain: n, prop: o, not_null: l, tool: s } = this.field, a = t[o];
|
|
6992
|
-
return a == null ? l ? this.parseNull() : this.parseDefault(a) : me.DOMAINS.linkage.includes(n) ? this.parseLinkage(t) : me.DOMAINS.multiple.includes(n) ? this.parseMultiple(t) : ["boolean", "switch"].includes(s) ? this.parseBoolean(a) : ["number"].includes(s) ? this.
|
|
6992
|
+
return a == null ? l ? this.parseNull() : this.parseDefault(a) : me.DOMAINS.linkage.includes(n) ? this.parseLinkage(t) : me.DOMAINS.multiple.includes(n) ? this.parseMultiple(t) : ["boolean", "switch"].includes(s) ? this.parseBoolean(a) : ["number"].includes(s) ? this._parseNumber(a) : ["date"].includes(s) ? n === "DateTimeField" ? this.parseDateTime(a) : this.parseDate(a) : ["time"].includes(s) ? this.parseTime(a) : ["timerange"].includes(s) ? this.parseTimeRange(a) : ["daterange"].includes(s) ? this.parseDateRange(a) : ["dates"].includes(s) ? this.parseDates(a) : ["set"].includes(s) ? this.parseSet(a) : ["color"].includes(s) ? this.parseColor(a) : ["file"].includes(s) ? this.parseFile(a) : this.parseDefault(a);
|
|
6993
6993
|
}
|
|
6994
6994
|
parseNull() {
|
|
6995
6995
|
return {
|
|
@@ -7012,7 +7012,7 @@ class cr {
|
|
|
7012
7012
|
const s = [!0, "是", 1, "1", "TRUE", "true", "True", "yes", "YES", "Yes"], a = [!1, "否", 0, "0", "FALSE", "false", "False", "no", "NO", "No"];
|
|
7013
7013
|
return s.includes(t) ? (t = !0, n = "是") : a.includes(t) ? (t = !1, n = "否") : (o = Dn(t), o ? n = t ? "是" : "否" : l = "非布尔型"), { value: t, content: n, valid: o, message: l };
|
|
7014
7014
|
}
|
|
7015
|
-
|
|
7015
|
+
_parseNumber(t) {
|
|
7016
7016
|
if (t == null) return this.parseDefault(t);
|
|
7017
7017
|
const { domain: n, format: { precision: o } } = this.field;
|
|
7018
7018
|
let [l, s, a] = [t, !0, ""];
|
|
@@ -7021,6 +7021,7 @@ class cr {
|
|
|
7021
7021
|
else {
|
|
7022
7022
|
const r = Number(t);
|
|
7023
7023
|
if (s = no(r) && !isNaN(r), s) {
|
|
7024
|
+
t = n === "FloatField" ? parseFloat(t) : parseInt(t);
|
|
7024
7025
|
const i = n === "FloatField" ? o || 2 : 0;
|
|
7025
7026
|
l = r.toFixed(i);
|
|
7026
7027
|
} else
|