New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sphereon/oid4vci-common

Package Overview
Dependencies
Maintainers
4
Versions
425
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sphereon/oid4vci-common - npm Package Compare versions

Comparing version 0.4.1-unstable.262 to 0.4.1-unstable.263

18

dist/functions/IssuerMetadataUtils.js

@@ -28,3 +28,3 @@ "use strict";

}
if (credentialsSupported === undefined) {
if (credentialsSupported === undefined || credentialsSupported.length === 0) {
return [];

@@ -42,3 +42,3 @@ }

if (typeof offerType === 'string') {
const supported = credentialsSupported.find((sup) => sup.id === offerType);
const supported = credentialsSupported.find((sup) => sup.id === offerType || sup.types.includes(offerType));
if (supported) {

@@ -49,3 +49,3 @@ credentialSupportedOverlap.push(supported);

else {
const supported = credentialsSupported.find((sup) => sup.types == offerType.types && sup.format === offerType.format);
const supported = credentialsSupported.find((sup) => arrayEqualsIgnoreOrder(sup.types, offerType.types) && sup.format === offerType.format);
if (supported) {

@@ -59,2 +59,14 @@ credentialSupportedOverlap.push(supported);

exports.getSupportedCredentials = getSupportedCredentials;
function arrayEqualsIgnoreOrder(a, b) {
if (a.length !== b.length)
return false;
const uniqueValues = new Set([...a, ...b]);
for (const v of uniqueValues) {
const aCount = a.filter((e) => e === v).length;
const bCount = b.filter((e) => e === v).length;
if (aCount !== bCount)
return false;
}
return true;
}
function credentialsSupportedV8ToV11(supportedV8) {

@@ -61,0 +73,0 @@ return Object.entries(supportedV8).flatMap((entry) => {

@@ -39,3 +39,3 @@ import {

if (credentialsSupported === undefined) {
if (credentialsSupported === undefined || credentialsSupported.length === 0) {
return [];

@@ -53,3 +53,3 @@ } else if (!credentialTypes || credentialTypes.length === 0) {

if (typeof offerType === 'string') {
const supported = credentialsSupported.find((sup) => sup.id === offerType);
const supported = credentialsSupported.find((sup) => sup.id === offerType || sup.types.includes(offerType));
if (supported) {

@@ -59,3 +59,3 @@ credentialSupportedOverlap.push(supported);

} else {
const supported = credentialsSupported.find((sup) => sup.types == offerType.types && sup.format === offerType.format);
const supported = credentialsSupported.find((sup) => arrayEqualsIgnoreOrder(sup.types, offerType.types) && sup.format === offerType.format);
if (supported) {

@@ -69,2 +69,13 @@ credentialSupportedOverlap.push(supported);

function arrayEqualsIgnoreOrder(a: string[], b: string[]) {
if (a.length !== b.length) return false;
const uniqueValues = new Set([...a, ...b]);
for (const v of uniqueValues) {
const aCount = a.filter((e) => e === v).length;
const bCount = b.filter((e) => e === v).length;
if (aCount !== bCount) return false;
}
return true;
}
export function credentialsSupportedV8ToV11(supportedV8: CredentialSupportedTypeV1_0_08): CredentialSupported[] {

@@ -71,0 +82,0 @@ return Object.entries(supportedV8).flatMap((entry) => {

4

package.json
{
"name": "@sphereon/oid4vci-common",
"version": "0.4.1-unstable.262+4fc4398",
"version": "0.4.1-unstable.263+9059375",
"description": "OpenID 4 Verifiable Credential Issuance Common Types",

@@ -48,3 +48,3 @@ "source": "lib/index.ts",

},
"gitHead": "4fc4398509aa08b04cc4a17eb04884aad15a9079"
"gitHead": "905937514221e72c7ad8a761c7d74b8cc7185744"
}

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