|
1 | | -importUnorderedListfrom"./task/unorderedList" |
2 | | -importOrderedListfrom"./task/orderedList" |
3 | | -importTaskOrderfrom"./task/taskOrder" |
4 | | - |
| 1 | +importUnorderedListfrom"./task/unorderedList"; |
| 2 | +importOrderedListfrom"./task/orderedList"; |
| 3 | +importTaskOrderfrom"./task/taskOrder"; |
5 | 4 |
|
6 | 5 | constcreateTaskOrder=()=>{ |
7 | | -returnnewTaskOrder() |
8 | | -} |
| 6 | +returnnewTaskOrder(); |
| 7 | +}; |
9 | 8 |
|
10 | 9 | constcreateTaskList=({ |
11 | 10 | requestCount, |
12 | 11 | taskCount, |
13 | 12 | responseCount, |
14 | 13 | resolveCount, |
15 | | - ordered=true |
16 | | -}={})=> |
17 | | -new(ordered ?OrderedList :UnorderedList)([ |
| 14 | + ordered=true, |
| 15 | +}={})=>{ |
| 16 | +if(requestCount||responseCount){ |
| 17 | +console.warn( |
| 18 | +"Please use an API after v1.0.0. The current API is already in an unsafe state." |
| 19 | +); |
| 20 | +} |
| 21 | +returnnew(ordered ?OrderedList :UnorderedList)([ |
18 | 22 | taskCount||requestCount||1, |
19 | | -resolveCount||responseCount||1 |
20 | | -]) |
| 23 | +resolveCount||responseCount||1, |
| 24 | +]); |
| 25 | +}; |
21 | 26 |
|
22 | | -export{createTaskList,createTaskOrder} |
| 27 | +export{createTaskList,createTaskOrder}; |