diff --git a/apps/dokploy/components/dashboard/settings/certificates/utils.ts b/apps/dokploy/components/dashboard/settings/certificates/utils.ts index 716087db2..e2aa59ef3 100644 --- a/apps/dokploy/components/dashboard/settings/certificates/utils.ts +++ b/apps/dokploy/components/dashboard/settings/certificates/utils.ts @@ -1,3 +1,5 @@ +// @ts-nocheck + export const extractExpirationDate = (certData: string): Date | null => { try { // Decode PEM base64 to DER binary @@ -12,11 +14,13 @@ export const extractExpirationDate = (certData: string): Date | null => { // Helper: read ASN.1 length field function readLength(pos: number): { length: number; offset: number } { + // biome-ignore lint/style/noParameterAssign: let len = der[pos++]; if (len & 0x80) { const bytes = len & 0x7f; len = 0; for (let i = 0; i < bytes; i++) { + // biome-ignore lint/style/noParameterAssign: len = (len << 8) + der[pos++]; } } @@ -68,19 +72,19 @@ export const extractExpirationDate = (certData: string): Date | null => { function parseTime(str: string): Date { if (str.length === 13) { // UTCTime YYMMDDhhmmssZ - const year = parseInt(str.slice(0, 2), 10); + const year = Number.parseInt(str.slice(0, 2), 10); const fullYear = year < 50 ? 2000 + year : 1900 + year; return new Date( `${fullYear}-${str.slice(2, 4)}-${str.slice(4, 6)}T${str.slice(6, 8)}:${str.slice(8, 10)}:${str.slice(10, 12)}Z`, ); - } else if (str.length === 15) { + } + if (str.length === 15) { // GeneralizedTime YYYYMMDDhhmmssZ return new Date( `${str.slice(0, 4)}-${str.slice(4, 6)}-${str.slice(6, 8)}T${str.slice(8, 10)}:${str.slice(10, 12)}:${str.slice(12, 14)}Z`, ); - } else { - throw new Error("Invalid ASN.1 time format"); } + throw new Error("Invalid ASN.1 time format"); } return parseTime(notAfterStr);