@everyonesoftware/common 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +54 -36
- package/package.json +6 -2
- package/sources/asyncIterator.ts +436 -436
- package/sources/asyncIteratorToJavascriptAsyncIteratorAdapter.ts +47 -47
- package/sources/asyncResult.ts +95 -95
- package/sources/byteList.ts +201 -201
- package/sources/byteListStream.ts +120 -120
- package/sources/byteReadStream.ts +23 -23
- package/sources/byteWriteStream.ts +15 -15
- package/sources/characterList.ts +194 -194
- package/sources/characterListStream.ts +150 -150
- package/sources/characterReadStream.ts +80 -80
- package/sources/characterReadStreamIterator.ts +127 -127
- package/sources/concatenateIterable.ts +118 -118
- package/sources/concatenateIterator.ts +164 -164
- package/sources/currentProcess.ts +157 -157
- package/sources/dateTime.ts +129 -129
- package/sources/depthFirstSearch.ts +229 -229
- package/sources/flatMapIterable.ts +103 -103
- package/sources/flatMapIterator.ts +151 -151
- package/sources/generator.ts +250 -250
- package/sources/index.ts +1 -1
- package/sources/iterator.ts +480 -480
- package/sources/javascriptAsyncIteratorToAsyncIteratorAdapter.ts +123 -123
- package/sources/javascriptSetSet.ts +133 -133
- package/sources/listQueue.ts +61 -61
- package/sources/listStack.ts +61 -61
- package/sources/luxonDateTime.ts +108 -108
- package/sources/mapAsyncIterator.ts +140 -140
- package/sources/mutableMap.ts +291 -291
- package/sources/node.ts +36 -36
- package/sources/promiseAsyncResult.ts +173 -173
- package/sources/queue.ts +48 -48
- package/sources/recreationDotGovClient.ts +258 -258
- package/sources/searchControl.ts +41 -41
- package/sources/set.ts +243 -243
- package/sources/skipAsyncIterator.ts +144 -144
- package/sources/stack.ts +47 -47
- package/sources/syncResult.ts +299 -299
- package/sources/takeAsyncIterator.ts +140 -140
- package/sources/whereAsyncIterator.ts +142 -142
- package/sources/wonderlandTrailClient.ts +1502 -1502
- package/tests/assertTestTests.ts +74 -74
- package/tests/byteListStreamTests.ts +389 -389
- package/tests/byteListTests.ts +26 -26
- package/tests/characterListStreamTests.ts +390 -390
- package/tests/characterListTests.ts +249 -249
- package/tests/dateTimeTests.ts +29 -29
- package/tests/depthFirstSearchTests.ts +105 -105
- package/tests/generatorTests.ts +85 -85
- package/tests/mutableMapTests.ts +153 -153
- package/tests/promiseAsyncResultTests.ts +687 -687
- package/tests/queueTests.ts +28 -28
- package/tests/recreationDotGovClientTests.ts +190 -190
- package/tests/setTests.ts +139 -139
- package/tests/stackTests.ts +65 -65
- package/tests/syncResultTests.ts +1250 -1250
- package/tests/wonderlandTrailClientTests.ts +451 -451
- package/tsup.config.ts +12 -12
package/sources/dateTime.ts
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import { LuxonDateTime } from "./luxonDateTime";
|
|
2
|
-
|
|
3
|
-
export abstract class DateTime
|
|
4
|
-
{
|
|
5
|
-
public static parse(text: string): DateTime
|
|
6
|
-
{
|
|
7
|
-
return LuxonDateTime.parse(text);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
public static now(): DateTime
|
|
11
|
-
{
|
|
12
|
-
return LuxonDateTime.now();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public abstract getYear(): number;
|
|
16
|
-
|
|
17
|
-
public abstract getMonth(): number;
|
|
18
|
-
|
|
19
|
-
public abstract getDay(): number;
|
|
20
|
-
|
|
21
|
-
public abstract getHour(): number;
|
|
22
|
-
|
|
23
|
-
public abstract getMinute(): number;
|
|
24
|
-
|
|
25
|
-
public abstract getSecond(): number;
|
|
26
|
-
|
|
27
|
-
public abstract addDays(days: number): DateTime;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Compare this {@link DateTime} to the provided {@link DateTime}. If this {@link DateTime} is
|
|
31
|
-
* less than the provided {@link DateTime}, then a negative number will be returned, 0 if
|
|
32
|
-
* they're equal, or a positive number if this {@link DateTime} is greater than the provided
|
|
33
|
-
* {@link DateTime}.
|
|
34
|
-
* @param dateTime The {@link DateTime} to compare to this {@link DateTime}.
|
|
35
|
-
*/
|
|
36
|
-
public compareTo(dateTime: DateTime, compareTimes: boolean): number
|
|
37
|
-
{
|
|
38
|
-
return DateTime.compareTo(this, dateTime, compareTimes);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public static compareTo(left: DateTime, right: DateTime, compareTimes: boolean): number
|
|
42
|
-
{
|
|
43
|
-
let result: number = left.getYear() - right.getYear();
|
|
44
|
-
if (result === 0)
|
|
45
|
-
{
|
|
46
|
-
result = left.getMonth() - right.getMonth();
|
|
47
|
-
if (result === 0)
|
|
48
|
-
{
|
|
49
|
-
result = left.getDay() - right.getDay();
|
|
50
|
-
if (compareTimes && result === 0)
|
|
51
|
-
{
|
|
52
|
-
result = left.getHour() - right.getHour();
|
|
53
|
-
if (result === 0)
|
|
54
|
-
{
|
|
55
|
-
result = left.getMinute() - right.getMinute();
|
|
56
|
-
if (result === 0)
|
|
57
|
-
{
|
|
58
|
-
result = left.getSecond(); - right.getSecond();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public lessThan(dateTime: DateTime, compareTimes: boolean): boolean
|
|
68
|
-
{
|
|
69
|
-
return DateTime.lessThan(this, dateTime, compareTimes);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public static lessThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
73
|
-
{
|
|
74
|
-
return left.compareTo(right, compareTimes) < 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean
|
|
78
|
-
{
|
|
79
|
-
return DateTime.lessThanOrEqualTo(this, dateTime, compareTimes);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public static lessThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
83
|
-
{
|
|
84
|
-
return left.compareTo(right, compareTimes) <= 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public equals(dateTime: DateTime, compareTimes: boolean): boolean
|
|
88
|
-
{
|
|
89
|
-
return DateTime.equals(this, dateTime, compareTimes);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public static equals(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
93
|
-
{
|
|
94
|
-
return left.compareTo(right, compareTimes) === 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean
|
|
98
|
-
{
|
|
99
|
-
return DateTime.greaterThanOrEqualTo(this, dateTime, compareTimes);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public static greaterThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
103
|
-
{
|
|
104
|
-
return left.compareTo(right, compareTimes) >= 0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public greaterThan(dateTime: DateTime, compareTimes: boolean): boolean
|
|
108
|
-
{
|
|
109
|
-
return DateTime.greaterThan(this, dateTime, compareTimes);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
public static greaterThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
113
|
-
{
|
|
114
|
-
return left.compareTo(right, compareTimes) > 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public get debug(): string
|
|
118
|
-
{
|
|
119
|
-
return DateTime.debug(this);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public static debug(dateTime: DateTime): string
|
|
123
|
-
{
|
|
124
|
-
return dateTime.toString();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public abstract toString(): string;
|
|
128
|
-
|
|
129
|
-
public abstract toDateString(): string;
|
|
1
|
+
import { LuxonDateTime } from "./luxonDateTime";
|
|
2
|
+
|
|
3
|
+
export abstract class DateTime
|
|
4
|
+
{
|
|
5
|
+
public static parse(text: string): DateTime
|
|
6
|
+
{
|
|
7
|
+
return LuxonDateTime.parse(text);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public static now(): DateTime
|
|
11
|
+
{
|
|
12
|
+
return LuxonDateTime.now();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public abstract getYear(): number;
|
|
16
|
+
|
|
17
|
+
public abstract getMonth(): number;
|
|
18
|
+
|
|
19
|
+
public abstract getDay(): number;
|
|
20
|
+
|
|
21
|
+
public abstract getHour(): number;
|
|
22
|
+
|
|
23
|
+
public abstract getMinute(): number;
|
|
24
|
+
|
|
25
|
+
public abstract getSecond(): number;
|
|
26
|
+
|
|
27
|
+
public abstract addDays(days: number): DateTime;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Compare this {@link DateTime} to the provided {@link DateTime}. If this {@link DateTime} is
|
|
31
|
+
* less than the provided {@link DateTime}, then a negative number will be returned, 0 if
|
|
32
|
+
* they're equal, or a positive number if this {@link DateTime} is greater than the provided
|
|
33
|
+
* {@link DateTime}.
|
|
34
|
+
* @param dateTime The {@link DateTime} to compare to this {@link DateTime}.
|
|
35
|
+
*/
|
|
36
|
+
public compareTo(dateTime: DateTime, compareTimes: boolean): number
|
|
37
|
+
{
|
|
38
|
+
return DateTime.compareTo(this, dateTime, compareTimes);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public static compareTo(left: DateTime, right: DateTime, compareTimes: boolean): number
|
|
42
|
+
{
|
|
43
|
+
let result: number = left.getYear() - right.getYear();
|
|
44
|
+
if (result === 0)
|
|
45
|
+
{
|
|
46
|
+
result = left.getMonth() - right.getMonth();
|
|
47
|
+
if (result === 0)
|
|
48
|
+
{
|
|
49
|
+
result = left.getDay() - right.getDay();
|
|
50
|
+
if (compareTimes && result === 0)
|
|
51
|
+
{
|
|
52
|
+
result = left.getHour() - right.getHour();
|
|
53
|
+
if (result === 0)
|
|
54
|
+
{
|
|
55
|
+
result = left.getMinute() - right.getMinute();
|
|
56
|
+
if (result === 0)
|
|
57
|
+
{
|
|
58
|
+
result = left.getSecond(); - right.getSecond();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public lessThan(dateTime: DateTime, compareTimes: boolean): boolean
|
|
68
|
+
{
|
|
69
|
+
return DateTime.lessThan(this, dateTime, compareTimes);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public static lessThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
73
|
+
{
|
|
74
|
+
return left.compareTo(right, compareTimes) < 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public lessThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean
|
|
78
|
+
{
|
|
79
|
+
return DateTime.lessThanOrEqualTo(this, dateTime, compareTimes);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public static lessThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
83
|
+
{
|
|
84
|
+
return left.compareTo(right, compareTimes) <= 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public equals(dateTime: DateTime, compareTimes: boolean): boolean
|
|
88
|
+
{
|
|
89
|
+
return DateTime.equals(this, dateTime, compareTimes);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public static equals(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
93
|
+
{
|
|
94
|
+
return left.compareTo(right, compareTimes) === 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public greaterThanOrEqualTo(dateTime: DateTime, compareTimes: boolean): boolean
|
|
98
|
+
{
|
|
99
|
+
return DateTime.greaterThanOrEqualTo(this, dateTime, compareTimes);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public static greaterThanOrEqualTo(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
103
|
+
{
|
|
104
|
+
return left.compareTo(right, compareTimes) >= 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public greaterThan(dateTime: DateTime, compareTimes: boolean): boolean
|
|
108
|
+
{
|
|
109
|
+
return DateTime.greaterThan(this, dateTime, compareTimes);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public static greaterThan(left: DateTime, right: DateTime, compareTimes: boolean): boolean
|
|
113
|
+
{
|
|
114
|
+
return left.compareTo(right, compareTimes) > 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public get debug(): string
|
|
118
|
+
{
|
|
119
|
+
return DateTime.debug(this);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public static debug(dateTime: DateTime): string
|
|
123
|
+
{
|
|
124
|
+
return dateTime.toString();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public abstract toString(): string;
|
|
128
|
+
|
|
129
|
+
public abstract toDateString(): string;
|
|
130
130
|
}
|