I am trying to generate a .csv file in an API stack. I am cycling through all our employees and aggregating data from their time cards for a weekly report. I need to add data into certain fields for when employees have time off. Time off is tracked as an array of objects within an employee's timesheet record for any given day. I am trying to move through a series of checks for different types of time offs and aggregate that time, as hours, to that specific field, but I am getting hung up on the main conditional that checks to see if the timeOffs[] array even has anything in it. In my test, I have an employee with time off for their birthday, and I see that birthday showing up in the console, but it is still getting skipped over in my stack and I am not sure why.
TLDR: How do I calculate whether timeOffs[] contains objects or if it is empty, using filters? I have tried count and is_empty and neither one works--it still skips right over it.
dailyTimesheet: {
id: 121840,
createdAt: 1740708003637,
updatedAt: null,
employeeFirstTimezone: null,
weeklyTimesheetId: 19844,
year: 2025,
month: 3,
week: 9,
weekUS: 10,
dayOfYear: 61,
dayOfMonth: 2,
employeeId: 308,
date: 2025-03-02,
lunchStatus: ,
changes: [0],
timeOffs: [0],
stayAwayPerDiemDailyBonus: null,
stayAwayTravelDailyBonus: null,
hourlyBonuses: [0]
}