Skip to content

Commit 5f48d2a

Browse files
authored
feat: export VC_JWT_ERROR as plain object (#121)
closes #120
1 parent ee396c0 commit 5f48d2a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
],
3737
"license": "ISC",
3838
"dependencies": {
39-
"did-jwt": "^6.5.0",
39+
"did-jwt": "^6.6.0",
4040
"did-resolver": "^4.0.0"
4141
},
4242
"repository": {

src/validators.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ import { JWT_ERROR } from 'did-jwt'
88
* Error prefixes used for known verification failure cases related to the
99
* {@link https://www.w3.org/TR/vc-data-model/ | Verifiable Credential data model }
1010
*/
11-
export const enum VC_ERROR {
11+
export const VC_ERROR = {
1212
/**
1313
* Thrown when the credential or presentation being verified does not conform to the data model defined by
1414
* {@link https://www.w3.org/TR/vc-data-model/ | the spec}
1515
*/
16-
SCHEMA_ERROR = 'schema_error',
16+
SCHEMA_ERROR: 'schema_error',
1717

1818
/**
1919
* Thrown when the input is not a JWT string
2020
*/
21-
FORMAT_ERROR = 'format_error',
21+
FORMAT_ERROR: 'format_error',
2222

2323
/**
2424
* Thrown when verifying a presentation where `challenge` and/or `domain` don't match the expected values.
2525
*/
26-
AUTH_ERROR = 'auth_error',
26+
AUTH_ERROR: 'auth_error',
2727
}
2828

2929
/**
3030
* Known validation or verification error prefixes.
3131
*/
32-
export type VC_JWT_ERROR = VC_ERROR | JWT_ERROR
32+
export const VC_JWT_ERROR = { ...VC_ERROR, ...JWT_ERROR }
3333

3434
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3535
function isDateObject(input: any): input is Date {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4440,10 +4440,10 @@ did-jwt@^6.1.2:
44404440
multiformats "^9.6.5"
44414441
uint8arrays "^3.0.0"
44424442

4443-
did-jwt@^6.5.0:
4444-
version "6.5.0"
4445-
resolved "https://registry.yarnpkg.com/did-jwt/-/did-jwt-6.5.0.tgz#0179ed25db32c111a667563c0d7b54e5d6ecb939"
4446-
integrity sha512-yfdqk2N6+161Yeay4HMC5daic/HRIsc+W1r7JQlNtL14fmQyaPgJxnxpXdc7Qmwd+pMlfpi1oOEtraExDE6MzQ==
4443+
did-jwt@^6.6.0:
4444+
version "6.6.0"
4445+
resolved "https://registry.yarnpkg.com/did-jwt/-/did-jwt-6.6.0.tgz#e7c932f7e3ff992b15aef7db3d530c81fb34902d"
4446+
integrity sha512-qSjXEEHS4fSbBHRCC/ObDzPVkCVvuXIfIiGWa03HNRr85gGkbxzBrxUsUbXfXo1CuzeCqmmZpK4nM4VWlZh6bQ==
44474447
dependencies:
44484448
"@stablelib/ed25519" "^1.0.2"
44494449
"@stablelib/random" "^1.0.1"

0 commit comments

Comments
 (0)