Skip to content

Commit

Permalink
chore: update some mapper methods to include param types when returni…
Browse files Browse the repository at this point in the history
…ng boolean results
  • Loading branch information
nklomp committed Apr 4, 2024
1 parent 717edc9 commit 0e764ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ssi-types/src/mapper/credential-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class CredentialMapper {
return '@context' in credential && ((credential as ICredential).type?.includes('VerifiableCredential') || false)
}

public static isCredential(original: OriginalVerifiableCredential | OriginalVerifiablePresentation): boolean {
public static isCredential(original: OriginalVerifiableCredential | OriginalVerifiablePresentation): original is OriginalVerifiableCredential {
try {
if (CredentialMapper.isJwtEncoded(original)) {
const vc: IVerifiableCredential = CredentialMapper.toUniformCredential(original)
Expand All @@ -312,7 +312,7 @@ export class CredentialMapper {
}
}

public static isPresentation(original: OriginalVerifiableCredential | OriginalVerifiablePresentation): boolean {
public static isPresentation(original: OriginalVerifiableCredential | OriginalVerifiablePresentation): original is OriginalVerifiablePresentation {
try {
if (CredentialMapper.isJwtEncoded(original)) {
const vp: IVerifiablePresentation = CredentialMapper.toUniformPresentation(original)
Expand Down

0 comments on commit 0e764ed

Please sign in to comment.