UNPKG
syllabusobject
Version:
latest (2.0.1)
2.0.1
2.0.0
1.0.0
A deterministic builder for static syllabus structures with filename-safe output.
syllabusobject
/
old2
/
src
/
utils
/
sortManager.js
8 lines
(6 loc)
•
221 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
// utils/sortManager.js
export
function
getNextSortOrder
(
list
) {
if
(!
Array
.
isArray
(list) || list.
length
===
0
)
return
1
;
const
max =
Math
.
max
(...list.
map
(
item
=>
item.
sortOrder
||
0
));
return
max +
1
; }