@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
1 lines • 1.34 kB
Source Map (JSON)
{"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"}