@shipload/sdk 2.0.0-rc12 → 2.0.0-rc13
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/lib/shipload.d.ts +5 -2
- package/lib/shipload.js +7 -3
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +7 -3
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/index-module.ts +1 -1
- package/src/scheduling/projection.ts +14 -3
package/lib/shipload.m.js
CHANGED
|
@@ -6697,12 +6697,16 @@ function applyTask(projected, task) {
|
|
|
6697
6697
|
break;
|
|
6698
6698
|
}
|
|
6699
6699
|
}
|
|
6700
|
-
function projectEntity(entity) {
|
|
6700
|
+
function projectEntity(entity, options) {
|
|
6701
6701
|
const projected = createProjectedEntity(entity);
|
|
6702
6702
|
if (!entity.schedule || entity.schedule.tasks.length === 0)
|
|
6703
6703
|
return projected;
|
|
6704
|
-
|
|
6705
|
-
|
|
6704
|
+
const tasks = entity.schedule.tasks;
|
|
6705
|
+
const taskCount = options?.upToTaskIndex !== undefined
|
|
6706
|
+
? Math.max(0, Math.min(options.upToTaskIndex, tasks.length))
|
|
6707
|
+
: tasks.length;
|
|
6708
|
+
for (let i = 0; i < taskCount; i++) {
|
|
6709
|
+
applyTask(projected, tasks[i]);
|
|
6706
6710
|
}
|
|
6707
6711
|
return projected;
|
|
6708
6712
|
}
|