refactor: clean code

This commit is contained in:
2024-12-18 06:57:27 +03:00
parent 3af8c43cd9
commit a2d4151cc3
47 changed files with 181 additions and 150 deletions

View File

@ -1,7 +1,7 @@
export interface PasswordPolicy {
minimumLength: number;
requireLetter: boolean;
requireLettersDifferentCase: boolean;
requireDigit: boolean;
requireSpecialCharacter: boolean;
minimumLength: number;
requireLetter: boolean;
requireLettersDifferentCase: boolean;
requireDigit: boolean;
requireSpecialCharacter: boolean;
}

View File

@ -9,10 +9,10 @@ export class TimeOnly {
if (hourOrTime instanceof Date) {
this._ticks = hourOrTime.getTime();
} else if (typeof hourOrTime === 'number' && minute !== undefined && second !== undefined) {
this._ticks = new Date(2000, 0, 1, hourOrTime, minute, second, 0).getTime()
this._ticks = new Date(2000, 0, 1, hourOrTime, minute, second, 0).getTime();
} else if (typeof hourOrTime === 'string') {
const [h, m, s] = hourOrTime.split(':').map(Number);
this._ticks = new Date(2000, 0, 1, h, m, s, 0).getTime()
this._ticks = new Date(2000, 0, 1, h, m, s, 0).getTime();
} else {
throw new Error('Invalid constructor arguments');
}
@ -35,7 +35,7 @@ export class TimeOnly {
}
toTimeWithoutSeconds(): string {
return `${String(this.hour).padStart(2, '0')}:${String(this.minute).padStart(2, '0')}`
return `${String(this.hour).padStart(2, '0')}:${String(this.minute).padStart(2, '0')}`;
}
toString(): string {

View File

@ -1,4 +1,4 @@
export interface PairPeriodTime {
start: string;
end: string;
start: string;
end: string;
}