1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isDateInterval = isDateInterval;
|
4 | exports.isDateRange = isDateRange;
|
5 | exports.isDateAfterType = isDateAfterType;
|
6 | exports.isDateBeforeType = isDateBeforeType;
|
7 | exports.isDayOfWeekType = isDayOfWeekType;
|
8 | exports.isDatesArray = isDatesArray;
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function isDateInterval(matcher) {
|
15 | return Boolean(matcher &&
|
16 | typeof matcher === "object" &&
|
17 | "before" in matcher &&
|
18 | "after" in matcher);
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | function isDateRange(value) {
|
26 | return Boolean(value && typeof value === "object" && "from" in value);
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | function isDateAfterType(value) {
|
34 | return Boolean(value && typeof value === "object" && "after" in value);
|
35 | }
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | function isDateBeforeType(value) {
|
42 | return Boolean(value && typeof value === "object" && "before" in value);
|
43 | }
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | function isDayOfWeekType(value) {
|
50 | return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
|
51 | }
|
52 |
|
53 | function isDatesArray(value, dateLib) {
|
54 | return Array.isArray(value) && value.every(dateLib.isDate);
|
55 | }
|
56 |
|
\ | No newline at end of file |