Skip to content

Commit

Permalink
Use context package named Map for context URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed Aug 1, 2024
1 parent dfbd226 commit 8e9fcc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*!
* Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
*/
import {named as vcNamedContexts} from '@digitalbazaar/credentials-context';

// Z and T must be uppercase
// xml schema date time RegExp
// @see https://www.w3.org/TR/xmlschema11-2/#dateTime
Expand All @@ -11,8 +13,8 @@ export const dateRegex = new RegExp(
'T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))' +
'(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?');

const CREDENTIALS_CONTEXT_V1_URL = 'https://www.w3.org/2018/credentials/v1';
const CREDENTIALS_CONTEXT_V2_URL = 'https://www.w3.org/ns/credentials/v2';
const CREDENTIALS_CONTEXT_V1_URL = vcNamedContexts.get('v1').id;
const CREDENTIALS_CONTEXT_V2_URL = vcNamedContexts.get('v2').id;

// mappings between credentials contexts and version numbers
const credentialsContextUrlToVersion = new Map([
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"lib/**/*.js"
],
"dependencies": {
"@digitalbazaar/credentials-context": "^3.0.0",
"@digitalbazaar/credentials-context": "^3.1.0",
"ed25519-signature-2018-context": "^1.1.0",
"jsonld": "^8.3.1",
"jsonld-signatures": "^11.2.1"
Expand Down

0 comments on commit 8e9fcc0

Please sign in to comment.