(payload: unknown)
| 216 | > |
| 217 | |
| 218 | function getSchedulePayloadFromValue(payload: unknown): ScheduleExecutionPayload | null { |
| 219 | if (!payload || typeof payload !== 'object') return null |
| 220 | const candidate = payload as Partial<ScheduleExecutionPayload> |
| 221 | if ( |
| 222 | typeof candidate.scheduleId !== 'string' || |
| 223 | typeof candidate.workflowId !== 'string' || |
| 224 | typeof candidate.now !== 'string' |
| 225 | ) { |
| 226 | return null |
| 227 | } |
| 228 | |
| 229 | return candidate as ScheduleExecutionPayload |
| 230 | } |
| 231 | |
| 232 | function getSchedulePayloadFromJob(job: Job): ScheduleExecutionPayload | null { |
| 233 | return getSchedulePayloadFromValue(job.payload) |
no outgoing calls
no test coverage detected