The first day whose cohort is of new users; '' when the records have no stated beginning.
(env: Env)
| 399 | const NEW_USER_WARMUP_DAYS = 30; |
| 400 | /** The first day whose cohort is of new users; '' when the records have no stated beginning. */ |
| 401 | function newUsersFrom(env: Env): string { |
| 402 | const raw = (env as { USER_RECORDS_FROM?: unknown }).USER_RECORDS_FROM; |
| 403 | return typeof raw === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(raw) ? addDays(raw, NEW_USER_WARMUP_DAYS) : ''; |
| 404 | } |
| 405 | /** |
| 406 | * A machine with an installed day counts as a user unless it was only ever seen in |
| 407 | * CI, or is a container seen on a single day. The same rule, in the same words, as |
no test coverage detected