@routevn/creator-model 1.3.3 → 1.3.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.
- package/package.json +1 -1
- package/src/model.js +12 -1
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -40,6 +40,7 @@ const LINE_UPDATE_ACTIONS_PRESERVE_PATHS = ["dialogue.content"];
|
|
|
40
40
|
const LINE_UPDATE_ACTIONS_PRESERVE_PATHS_SET = new Set(
|
|
41
41
|
LINE_UPDATE_ACTIONS_PRESERVE_PATHS,
|
|
42
42
|
);
|
|
43
|
+
const isPositiveFiniteNumber = (value) => isFiniteNumber(value) && value > 0;
|
|
43
44
|
const createEmptyCollectionState = () => ({
|
|
44
45
|
items: {},
|
|
45
46
|
tree: [],
|
|
@@ -973,7 +974,7 @@ const validateSpritesheetAnimationMap = ({
|
|
|
973
974
|
{
|
|
974
975
|
const result = validateAllowedKeys({
|
|
975
976
|
value: animation,
|
|
976
|
-
allowedKeys: ["frames", "animationSpeed", "loop"],
|
|
977
|
+
allowedKeys: ["frames", "animationSpeed", "fps", "loop"],
|
|
977
978
|
path: animationPath,
|
|
978
979
|
errorFactory,
|
|
979
980
|
});
|
|
@@ -1009,6 +1010,16 @@ const validateSpritesheetAnimationMap = ({
|
|
|
1009
1010
|
);
|
|
1010
1011
|
}
|
|
1011
1012
|
|
|
1013
|
+
if (
|
|
1014
|
+
animation.fps !== undefined &&
|
|
1015
|
+
!isPositiveFiniteNumber(animation.fps)
|
|
1016
|
+
) {
|
|
1017
|
+
return invalidFromErrorFactory(
|
|
1018
|
+
errorFactory,
|
|
1019
|
+
`${animationPath}.fps must be a positive finite number when provided`,
|
|
1020
|
+
);
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1012
1023
|
if (animation.loop !== undefined && typeof animation.loop !== "boolean") {
|
|
1013
1024
|
return invalidFromErrorFactory(
|
|
1014
1025
|
errorFactory,
|