| 1124 | * hours: [9], |
| 1125 | * days: [1, 15], |
| 1126 | * months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], |
| 1127 | * weekdays: [1, 2, 3, 4, 5] |
| 1128 | * }) |
| 1129 | * |
| 1130 | * const cron2 = Cron.make({ |
| 1131 | * minutes: [0], |
| 1132 | * hours: [9], |
| 1133 | * days: [1, 15], |
| 1134 | * months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], |
| 1135 | * weekdays: [1, 2, 3, 4, 5] |
| 1136 | * }) |
| 1137 | * |
| 1138 | * Cron.equals(cron1, cron2) // => true |
| 1139 | * Cron.equals(cron1)(cron2) // => true |
| 1140 | * ``` |
| 1141 | * |
| 1142 | * @see {@link Equivalence} for the reusable equivalence instance |
| 1143 | * |
| 1144 | * @category predicates |
| 1145 | * @since 2.0.0 |
| 1146 | */ |
| 1147 | export const equals: { |
| 1148 | (that: Cron): (self: Cron) => boolean |
| 1149 | (self: Cron, that: Cron): boolean |
| 1150 | } = dual(2, (self: Cron, that: Cron): boolean => Equivalence(self, that)) |
| 1151 | |
| 1152 | interface SegmentOptions { |
| 1153 | min: number |
| 1154 | max: number |
| 1155 | aliases?: Record<string, number> | undefined |
| 1156 | normalize?: ((value: number) => number) | undefined |
| 1157 | } |
| 1158 | |
| 1159 | interface ParsedSegment { |
| 1160 | readonly values: Set<number> |
| 1161 | readonly wildcard: boolean |
| 1162 | } |
| 1163 | |
| 1164 | const secondOptions: SegmentOptions = { |
| 1165 | min: 0, |
| 1166 | max: 59 |
| 1167 | } |
| 1168 | |
| 1169 | const minuteOptions: SegmentOptions = { |
| 1170 | min: 0, |
| 1171 | max: 59 |
| 1172 | } |
| 1173 | |
| 1174 | const hourOptions: SegmentOptions = { |
| 1175 | min: 0, |
| 1176 | max: 23 |
| 1177 | } |
| 1178 | |
| 1179 | const dayOptions: SegmentOptions = { |
| 1180 | min: 1, |
| 1181 | max: 31 |
| 1182 | } |
| 1183 | |