@mtgame/core 0.1.80 → 0.1.82
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.
- package/bundles/mtgame-core.umd.js +14 -7
- package/bundles/mtgame-core.umd.js.map +1 -1
- package/esm2015/models/basketball-game-log.js +2 -1
- package/esm2015/models/util.js +14 -8
- package/fesm2015/mtgame-core.js +14 -7
- package/fesm2015/mtgame-core.js.map +1 -1
- package/models/basketball-game-log.d.ts +1 -0
- package/mtgame-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -430,6 +430,9 @@
|
|
|
430
430
|
function enumField(enumClass) {
|
|
431
431
|
return {
|
|
432
432
|
toFront: function (value) {
|
|
433
|
+
if (value === null || value === undefined) {
|
|
434
|
+
return value;
|
|
435
|
+
}
|
|
433
436
|
if (isNaN(+value)) {
|
|
434
437
|
return enumClass[value];
|
|
435
438
|
}
|
|
@@ -438,6 +441,9 @@
|
|
|
438
441
|
}
|
|
439
442
|
},
|
|
440
443
|
toBack: function (value) {
|
|
444
|
+
if (value === null || value === undefined) {
|
|
445
|
+
return value;
|
|
446
|
+
}
|
|
441
447
|
if (isNaN(+value)) {
|
|
442
448
|
return value;
|
|
443
449
|
}
|
|
@@ -542,11 +548,11 @@
|
|
|
542
548
|
if (config.relation) {
|
|
543
549
|
target[MODEL_RELATION_KEY] = config.relation;
|
|
544
550
|
}
|
|
545
|
-
target[MODEL_TO_FRONT_KEY] = function (dto
|
|
546
|
-
return toFront(target, dto
|
|
551
|
+
target[MODEL_TO_FRONT_KEY] = function (dto) {
|
|
552
|
+
return toFront(target, dto);
|
|
547
553
|
};
|
|
548
|
-
target[MODEL_TO_BACK_KEY] = function (dto
|
|
549
|
-
return toBack(target, dto
|
|
554
|
+
target[MODEL_TO_BACK_KEY] = function (dto) {
|
|
555
|
+
return toBack(target, dto);
|
|
550
556
|
};
|
|
551
557
|
}
|
|
552
558
|
};
|
|
@@ -560,7 +566,7 @@
|
|
|
560
566
|
}
|
|
561
567
|
var parseMethod = target[MODEL_TO_FRONT_KEY];
|
|
562
568
|
if (parseMethod) {
|
|
563
|
-
return parseMethod(args[0]
|
|
569
|
+
return parseMethod(args[0]);
|
|
564
570
|
}
|
|
565
571
|
return undefined;
|
|
566
572
|
}
|
|
@@ -615,7 +621,7 @@
|
|
|
615
621
|
}
|
|
616
622
|
return data;
|
|
617
623
|
}
|
|
618
|
-
function toFront(modelType, data
|
|
624
|
+
function toFront(modelType, data) {
|
|
619
625
|
var e_3, _a;
|
|
620
626
|
// Check if recursion is required
|
|
621
627
|
if (Array.isArray(data)) {
|
|
@@ -651,7 +657,7 @@
|
|
|
651
657
|
}
|
|
652
658
|
return instance;
|
|
653
659
|
}
|
|
654
|
-
function toBack(modelType, instance
|
|
660
|
+
function toBack(modelType, instance) {
|
|
655
661
|
var e_4, _a;
|
|
656
662
|
if (!instance) {
|
|
657
663
|
return instance;
|
|
@@ -3319,6 +3325,7 @@
|
|
|
3319
3325
|
is_coach: 'isCoach',
|
|
3320
3326
|
is_bench: 'isBench',
|
|
3321
3327
|
group: 'group',
|
|
3328
|
+
marked: 'marked',
|
|
3322
3329
|
},
|
|
3323
3330
|
relation: {
|
|
3324
3331
|
datetime: DateTimeField,
|