@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.
Files changed (59) hide show
  1. package/.github/workflows/publish.yml +54 -36
  2. package/package.json +6 -2
  3. package/sources/asyncIterator.ts +436 -436
  4. package/sources/asyncIteratorToJavascriptAsyncIteratorAdapter.ts +47 -47
  5. package/sources/asyncResult.ts +95 -95
  6. package/sources/byteList.ts +201 -201
  7. package/sources/byteListStream.ts +120 -120
  8. package/sources/byteReadStream.ts +23 -23
  9. package/sources/byteWriteStream.ts +15 -15
  10. package/sources/characterList.ts +194 -194
  11. package/sources/characterListStream.ts +150 -150
  12. package/sources/characterReadStream.ts +80 -80
  13. package/sources/characterReadStreamIterator.ts +127 -127
  14. package/sources/concatenateIterable.ts +118 -118
  15. package/sources/concatenateIterator.ts +164 -164
  16. package/sources/currentProcess.ts +157 -157
  17. package/sources/dateTime.ts +129 -129
  18. package/sources/depthFirstSearch.ts +229 -229
  19. package/sources/flatMapIterable.ts +103 -103
  20. package/sources/flatMapIterator.ts +151 -151
  21. package/sources/generator.ts +250 -250
  22. package/sources/index.ts +1 -1
  23. package/sources/iterator.ts +480 -480
  24. package/sources/javascriptAsyncIteratorToAsyncIteratorAdapter.ts +123 -123
  25. package/sources/javascriptSetSet.ts +133 -133
  26. package/sources/listQueue.ts +61 -61
  27. package/sources/listStack.ts +61 -61
  28. package/sources/luxonDateTime.ts +108 -108
  29. package/sources/mapAsyncIterator.ts +140 -140
  30. package/sources/mutableMap.ts +291 -291
  31. package/sources/node.ts +36 -36
  32. package/sources/promiseAsyncResult.ts +173 -173
  33. package/sources/queue.ts +48 -48
  34. package/sources/recreationDotGovClient.ts +258 -258
  35. package/sources/searchControl.ts +41 -41
  36. package/sources/set.ts +243 -243
  37. package/sources/skipAsyncIterator.ts +144 -144
  38. package/sources/stack.ts +47 -47
  39. package/sources/syncResult.ts +299 -299
  40. package/sources/takeAsyncIterator.ts +140 -140
  41. package/sources/whereAsyncIterator.ts +142 -142
  42. package/sources/wonderlandTrailClient.ts +1502 -1502
  43. package/tests/assertTestTests.ts +74 -74
  44. package/tests/byteListStreamTests.ts +389 -389
  45. package/tests/byteListTests.ts +26 -26
  46. package/tests/characterListStreamTests.ts +390 -390
  47. package/tests/characterListTests.ts +249 -249
  48. package/tests/dateTimeTests.ts +29 -29
  49. package/tests/depthFirstSearchTests.ts +105 -105
  50. package/tests/generatorTests.ts +85 -85
  51. package/tests/mutableMapTests.ts +153 -153
  52. package/tests/promiseAsyncResultTests.ts +687 -687
  53. package/tests/queueTests.ts +28 -28
  54. package/tests/recreationDotGovClientTests.ts +190 -190
  55. package/tests/setTests.ts +139 -139
  56. package/tests/stackTests.ts +65 -65
  57. package/tests/syncResultTests.ts +1250 -1250
  58. package/tests/wonderlandTrailClientTests.ts +451 -451
  59. package/tsup.config.ts +12 -12
@@ -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
  }