(
now: Date,
tags: string[] | undefined,
{ tags: deployTags, ...window }: PatchyConfig['fridayDeploy'],
)
| 41 | const FRIDAY = 5; |
| 42 | |
| 43 | export const isFridayDeploy = ( |
| 44 | now: Date, |
| 45 | tags: string[] | undefined, |
| 46 | { tags: deployTags, ...window }: PatchyConfig['fridayDeploy'], |
| 47 | ): boolean => { |
| 48 | if (getWindowStartDay(now, window)?.getDay() !== FRIDAY) { |
| 49 | return false; |
| 50 | } |
| 51 | const deploy = new Set(deployTags.map((tag) => tag.toLowerCase())); |
| 52 | return !!tags?.some((tag) => deploy.has(tag.toLowerCase())); |
| 53 | }; |
| 54 | |
| 55 | // Away = the last counted read is older than `awayMs` and nothing today yet. |
| 56 | export const isAway = ( |
no test coverage detected