saibo-kanban 0.5.4 → 0.5.5
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/CHANGELOG.md +4 -0
- package/core.js +3 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/core.js
CHANGED
|
@@ -81,14 +81,12 @@ export function assertTitle(title) {
|
|
|
81
81
|
return title.trim();
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* 校验状态值。任意状态之间可以互转(回滚兜底),只拒绝未知状态。
|
|
86
|
+
*/
|
|
85
87
|
export function assertTransition(from, to) {
|
|
86
88
|
if (from === to) return;
|
|
87
89
|
assertStatus(to);
|
|
88
|
-
const allowed = TRANSITIONS[from] || [];
|
|
89
|
-
if (!allowed.includes(to)) {
|
|
90
|
-
throw new BoardError('INVALID_TRANSITION', `状态不能从 ${from} 直接变成 ${to}`);
|
|
91
|
-
}
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
export function nextId() {
|