{"version":3,"file":"convertLegacyTrustedCertificates.mjs","names":[],"sources":["../../../../src/modules/x509/utils/convertLegacyTrustedCertificates.ts"],"sourcesContent":["import type { TrustedIssuerX509 } from '../../../agent/TrustedIssuersForVerification'\nimport type { X509VerificationTrustedCertificates } from '../X509ModuleConfig'\n\nexport function convertLegacyTrustedCertificates(\n  trustedCertificates: string[] | X509VerificationTrustedCertificates[]\n): X509VerificationTrustedCertificates[] {\n  return trustedCertificates.every((tc) => typeof tc === 'string')\n    ? trustedCertificates.map((tc) => ({ issuance: [tc] }))\n    : (trustedCertificates as X509VerificationTrustedCertificates[])\n}\n\nexport function legacyTrustedCertificatesToTrustedIssuers(\n  trustedCertificates: string[] | X509VerificationTrustedCertificates[]\n): TrustedIssuerX509[] {\n  return convertLegacyTrustedCertificates(trustedCertificates).map((certificate) => ({\n    method: 'x509',\n    issuance: certificate.issuance,\n    status: certificate.status,\n  }))\n}\n"],"mappings":";AAGA,SAAgB,iCACd,qBACuC;CACvC,OAAO,oBAAoB,OAAO,OAAO,OAAO,OAAO,QAAQ,IAC3D,oBAAoB,KAAK,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,IACnD;AACP;AAEA,SAAgB,0CACd,qBACqB;CACrB,OAAO,iCAAiC,mBAAmB,CAAC,CAAC,KAAK,iBAAiB;EACjF,QAAQ;EACR,UAAU,YAAY;EACtB,QAAQ,YAAY;CACtB,EAAE;AACJ"}