Skip to content

Commit ac35ada

Browse files
committed
chore: Fix Number/number mismatch for TypeScript 5 migration
When testing typescript 5.0.4, several lines in Recurrence.ts give: error TS2365: Operator '>' cannot be applied to types 'number' and 'Number' This fixes that error.
1 parent 8cfd4af commit ac35ada

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Recurrence.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export class Recurrence {
279279
skippingMonths: string | undefined,
280280
): Moment {
281281
// Parse `skippingMonths`, if it exists.
282-
let parsedSkippingMonths: Number = 1;
282+
let parsedSkippingMonths: number = 1;
283283
if (skippingMonths !== undefined) {
284284
parsedSkippingMonths = Number.parseInt(skippingMonths.trim(), 10);
285285
}
@@ -297,7 +297,7 @@ export class Recurrence {
297297
/**
298298
* isSkippingTooManyMonths returns true if `next` is more than `skippingMonths` months after `after`.
299299
*/
300-
private static isSkippingTooManyMonths(after: Moment, next: Moment, skippingMonths: Number): boolean {
300+
private static isSkippingTooManyMonths(after: Moment, next: Moment, skippingMonths: number): boolean {
301301
let diffMonths = next.month() - after.month();
302302

303303
// Maybe some years have passed?
@@ -319,7 +319,7 @@ export class Recurrence {
319319
skippingYears: string | undefined,
320320
): Moment {
321321
// Parse `skippingYears`, if it exists.
322-
let parsedSkippingYears: Number = 1;
322+
let parsedSkippingYears: number = 1;
323323
if (skippingYears !== undefined) {
324324
parsedSkippingYears = Number.parseInt(skippingYears.trim(), 10);
325325
}
@@ -337,7 +337,7 @@ export class Recurrence {
337337
/**
338338
* isSkippingTooManyYears returns true if `next` is more than `skippingYears` years after `after`.
339339
*/
340-
private static isSkippingTooManyYears(after: Moment, next: Moment, skippingYears: Number): boolean {
340+
private static isSkippingTooManyYears(after: Moment, next: Moment, skippingYears: number): boolean {
341341
const diff = next.year() - after.year();
342342

343343
return diff > skippingYears;

0 commit comments

Comments
 (0)