File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ sonar.qualitygate.wait=true
55sonar.sourceEncoding =UTF-8
66sonar.sources =src
77sonar.coverage.exclusions =src/**/*.test.ts*, src/app/layout.tsx
8+ sonar.cpd.exclusions ==src/**/*.test.ts*
89
910# sonar.python.coverage.reportPaths=.coverage/coverage.xml
1011sonar.typescript.lcov.reportPaths =lcov.info
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const CampaignSchema = z
1919export type Campaign = z . infer < typeof CampaignSchema > ;
2020
2121export class Campaigns {
22- private schedule : Partial < Record < VaccineType , Campaign [ ] > > ;
22+ private readonly schedule : Partial < Record < VaccineType , Campaign [ ] > > ;
2323
2424 constructor ( schedule : Partial < Record < VaccineType , Campaign [ ] > > ) {
2525 this . schedule = schedule ;
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ export const UtcDateFromStringSchema = z
44 . string ( )
55 . regex ( / ^ \d { 4 } - \d { 2 } - \d { 2 } $ / , "Date must be in YYYY-MM-DD format" )
66 . transform ( ( str , ctx ) => {
7- const year = parseInt ( str . slice ( 0 , 4 ) ) ;
8- const month = parseInt ( str . slice ( 5 , 7 ) ) ; // 1-indexed (01 = Jan)
9- const day = parseInt ( str . slice ( 8 , 10 ) ) ;
7+ const year = Number . parseInt ( str . slice ( 0 , 4 ) ) ;
8+ const month = Number . parseInt ( str . slice ( 5 , 7 ) ) ; // 1-indexed (01 = Jan)
9+ const day = Number . parseInt ( str . slice ( 8 , 10 ) ) ;
1010 const utcTimestamp = Date . UTC ( year , month - 1 , day ) ;
1111 const date = new Date ( utcTimestamp ) ;
1212 if ( date . getUTCFullYear ( ) !== year || date . getUTCMonth ( ) !== month - 1 || date . getUTCDate ( ) !== day ) {
@@ -21,7 +21,7 @@ export const UtcDateTimeFromStringSchema = z.iso
2121 . transform ( ( str , ctx ) => {
2222 const date = new Date ( str ) ;
2323
24- if ( isNaN ( date . getTime ( ) ) ) {
24+ if ( Number . isNaN ( date . getTime ( ) ) ) {
2525 ctx . addIssue ( { code : "custom" , message : "Invalid date value" } ) ;
2626 return z . NEVER ;
2727 }
You can’t perform that action at this time.
0 commit comments