@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.15 kB
Source Map (JSON)
{"version":3,"file":"disclosureFrame.mjs","names":[],"sources":["../../../src/modules/sd-jwt-vc/disclosureFrame.ts"],"sourcesContent":["import { isObject } from 'class-validator'\nimport type { JsonObject } from '../../types'\n\ntype DisclosureFrame = {\n [key: string]: boolean | DisclosureFrame\n}\n\nexport function buildDisclosureFrameForPayload(input: JsonObject): DisclosureFrame {\n return Object.fromEntries(\n Object.entries(input).map(([key, value]) => {\n // TODO: Array disclosure frames are not yet supported - treating entire array as disclosed\n if (Array.isArray(value)) {\n return [key, true]\n }\n if (isObject(value)) {\n if (Object.keys.length === 0) return [key, false]\n return [key, buildDisclosureFrameForPayload(value)]\n }\n return [key, true]\n })\n )\n}\n"],"mappings":";;;;;AAOA,SAAgB,+BAA+B,OAAoC;AACjF,QAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW;AAE1C,MAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,CAAC,KAAK,KAAK;AAEpB,MAAI,SAAS,MAAM,EAAE;AACnB,OAAI,OAAO,KAAK,WAAW,EAAG,QAAO,CAAC,KAAK,MAAM;AACjD,UAAO,CAAC,KAAK,+BAA+B,MAAM,CAAC;;AAErD,SAAO,CAAC,KAAK,KAAK;GAClB,CACH"}