@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.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
- for (const task of entity.schedule.tasks) {
6705
- applyTask(projected, task);
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
  }