@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.26 kB
Source Map (JSON)
{"version":3,"file":"W3cV2CredentialSchema.mjs","names":[],"sources":["../../../../../src/modules/vc/models/credential/W3cV2CredentialSchema.ts"],"sourcesContent":["import { plainToClassFromExist } from 'class-transformer'\nimport { IsString } from 'class-validator'\nimport { IsUri } from '../../../../utils'\n\nexport interface W3cV2CredentialSchemaOptions {\n id: string\n type: string\n [property: string]: unknown\n}\n\n/**\n * Represents a credential schema.\n *\n * @see https://www.w3.org/TR/vc-data-model-2.0/#data-schemas\n */\nexport class W3cV2CredentialSchema {\n public constructor(options: W3cV2CredentialSchemaOptions) {\n if (options) {\n const { id, type, ...rest } = options\n\n plainToClassFromExist(this, rest)\n\n this.id = id\n this.type = type\n }\n }\n\n @IsUri()\n public id!: string\n\n @IsString()\n public type!: string;\n\n [property: string]: unknown\n}\n"],"mappings":";;;;;;;;;;;;AAeA,IAAa,wBAAb,MAAmC;CACjC,YAAmB,SAAuC;EACxD,IAAI,SAAS;GACX,MAAM,EAAE,IAAI,MAAM,GAAG,SAAS;GAE9B,sBAAsB,MAAM,IAAI;GAEhC,KAAK,KAAK;GACV,KAAK,OAAO;EACd;CACF;AASF;AAPG,WAAA,CAAA,MAAM,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,sBAAA,WAAA,MAAA,KAAA,CAAA;AAGN,WAAA,CAAA,SAAS,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,sBAAA,WAAA,QAAA,KAAA,CAAA"}