Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sphereon/ssi-types

Package Overview
Dependencies
Maintainers
4
Versions
1177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sphereon/ssi-types - npm Package Compare versions

Comparing version 0.8.1-unstable.200 to 0.8.1-unstable.201

28

dist/mapper/credential-mapper.js

@@ -220,14 +220,18 @@ "use strict";

static toExternalVerifiableCredential(verifiableCredential) {
if (!verifiableCredential.proof.type) {
throw new Error('Verifiable credential proof is missing a type');
let proof;
if (verifiableCredential.proof) {
if (!verifiableCredential.proof.type) {
throw new Error('Verifiable credential proof is missing a type');
}
if (!verifiableCredential.proof.created) {
throw new Error('Verifiable credential proof is missing a created date');
}
if (!verifiableCredential.proof.proofPurpose) {
throw new Error('Verifiable credential proof is missing a proof purpose');
}
if (!verifiableCredential.proof.verificationMethod) {
throw new Error('Verifiable credential proof is missing a verification method');
}
proof = Object.assign(Object.assign({}, verifiableCredential.proof), { type: verifiableCredential.proof.type, created: verifiableCredential.proof.created, proofPurpose: verifiableCredential.proof.proofPurpose, verificationMethod: verifiableCredential.proof.verificationMethod });
}
if (!verifiableCredential.proof.created) {
throw new Error('Verifiable credential proof is missing a created date');
}
if (!verifiableCredential.proof.proofPurpose) {
throw new Error('Verifiable credential proof is missing a proof purpose');
}
if (!verifiableCredential.proof.verificationMethod) {
throw new Error('Verifiable credential proof is missing a verification method');
}
return Object.assign(Object.assign({}, verifiableCredential), { type: verifiableCredential.type

@@ -237,3 +241,3 @@ ? typeof verifiableCredential.type === 'string'

: verifiableCredential.type
: ['VerifiableCredential'], proof: Object.assign(Object.assign({}, verifiableCredential.proof), { type: verifiableCredential.proof.type, created: verifiableCredential.proof.created, proofPurpose: verifiableCredential.proof.proofPurpose, verificationMethod: verifiableCredential.proof.verificationMethod }) });
: ['VerifiableCredential'], proof });
}

@@ -240,0 +244,0 @@ }

{
"name": "@sphereon/ssi-types",
"description": "SSI Common Types",
"version": "0.8.1-unstable.200+559efe2",
"version": "0.8.1-unstable.201+f04345b",
"main": "dist/index.js",

@@ -41,3 +41,3 @@ "types": "dist/index.d.ts",

],
"gitHead": "559efe254d9b5780b8cd10ca8e70875c3c835ca0"
"gitHead": "f04345b97ff9a78a3dff096599f0b675b3239a3e"
}

@@ -277,16 +277,26 @@ import {

static toExternalVerifiableCredential(verifiableCredential: any): IVerifiableCredential {
if (!verifiableCredential.proof.type) {
throw new Error('Verifiable credential proof is missing a type')
}
let proof
if (verifiableCredential.proof) {
if (!verifiableCredential.proof.type) {
throw new Error('Verifiable credential proof is missing a type')
}
if (!verifiableCredential.proof.created) {
throw new Error('Verifiable credential proof is missing a created date')
}
if (!verifiableCredential.proof.created) {
throw new Error('Verifiable credential proof is missing a created date')
}
if (!verifiableCredential.proof.proofPurpose) {
throw new Error('Verifiable credential proof is missing a proof purpose')
}
if (!verifiableCredential.proof.proofPurpose) {
throw new Error('Verifiable credential proof is missing a proof purpose')
}
if (!verifiableCredential.proof.verificationMethod) {
throw new Error('Verifiable credential proof is missing a verification method')
if (!verifiableCredential.proof.verificationMethod) {
throw new Error('Verifiable credential proof is missing a verification method')
}
proof = {
...verifiableCredential.proof,
type: verifiableCredential.proof.type,
created: verifiableCredential.proof.created,
proofPurpose: verifiableCredential.proof.proofPurpose,
verificationMethod: verifiableCredential.proof.verificationMethod,
}
}

@@ -301,11 +311,5 @@

: ['VerifiableCredential'],
proof: {
...verifiableCredential.proof,
type: verifiableCredential.proof.type,
created: verifiableCredential.proof.created,
proofPurpose: verifiableCredential.proof.proofPurpose,
verificationMethod: verifiableCredential.proof.verificationMethod,
},
proof,
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc