(value)
| 119 | } |
| 120 | |
| 121 | function parseMinimumAge(value) { |
| 122 | const days = Number.parseInt(value, 10); |
| 123 | if (!Number.isInteger(days) || days < 0) { |
| 124 | throw new Error(`Invalid minimum age: ${value}`); |
| 125 | } |
| 126 | return days; |
| 127 | } |
| 128 | |
| 129 | function accountAgeDays(createdAt, nowValue) { |
| 130 | const createdTime = Date.parse(createdAt); |