Skip to content

Commit a177d13

Browse files
committed
Clean up.
1 parent 9c0494c commit a177d13

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

src/implementation/Server/DaprServer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import DaprClient from "../Client/DaprClient";
3939
import { getClientOptions } from "../../utils/Client.util";
4040

4141

42-
4342
export default class DaprServer {
4443
// App details
4544
private readonly serverOptions: DaprServerOptions;

src/types/BuildNumberRange.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
Copyright 2025 The Dapr Authors
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
export type BuildNumberRange<T extends number, U extends number, R extends number[] = []> = R["length"] extends U
15+
? R[number]
16+
: BuildNumberRange<T, U, [...R, R["length"] & number]>;

src/types/jobs/CronExpression.type.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ limitations under the License.
1212
*/
1313

1414
// note: This can get crazy, more than TS can really handle.
15+
import { BuildNumberRange } from "../BuildNumberRange";
16+
1517
export type CronExpressionString = `${string} ${string} ${string} ${string} ${string} ${string}`;
1618

1719
export enum CronPeriod {
@@ -23,11 +25,11 @@ export enum CronPeriod {
2325
Month,
2426
}
2527

26-
export type SecondOrMinute = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;
27-
export type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
28-
export type DayOfMonth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
29-
export type DayOfWeekNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6;
30-
export type MonthNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
28+
export type SecondOrMinute = BuildNumberRange<0, 59>;
29+
export type Hour = BuildNumberRange<0, 23>;
30+
export type DayOfMonth = BuildNumberRange<1, 31>;
31+
export type DayOfWeekNumber = BuildNumberRange<0, 6>;
32+
export type MonthNumber = BuildNumberRange<1, 12>;
3133

3234
export enum DayOfWeek {
3335
Sunday = "SUN",

test/e2e/jobs/jobs.test.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ describe("Jobs End to End", () => {
9797
"--enable-api-logging",
9898
])
9999
.withWaitStrategy(Wait.forLogMessage("dapr initialized. Status: Running.").withStartupTimeout(10000))
100-
// .withWaitStrategy(Wait.forLogMessage("HTTP server is running on port").withStartupTimeout(10000))
101-
// .withWaitStrategy(Wait.forHttp("/v1.0/healthz/outbound", 8082).forStatusCodeMatching((statusCode) => statusCode >= 200 && statusCode <= 399))
102-
// .withStartupTimeout(120_000)
103100
.start()
104101
;
105102
});
@@ -142,10 +139,10 @@ describe("Jobs End to End", () => {
142139

143140
expect(callback).toHaveBeenCalledTimes(times);
144141
});
142+
});
145143

146-
function getPort(container: StartedTestContainer | null | undefined, port: number): string {
147-
if (!container) throw new Error("Container is null or undefined?");
144+
function getPort(container: StartedTestContainer | null | undefined, port: number): string {
145+
if (!container) throw new Error("Container is null or undefined?");
148146

149-
return container.getMappedPort(port).toString();
150-
}
151-
});
147+
return container.getMappedPort(port).toString();
148+
}

0 commit comments

Comments
 (0)