Skip to content

Commit

Permalink
fix: obfuscation return type should still have a compliant attachment… (
Browse files Browse the repository at this point in the history
#293)

* fix: obfuscation return type should still have a compliant attachment array

* fix: improve typing more
  • Loading branch information
phanshiyu authored May 13, 2024
1 parent facd046 commit 69bd41a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/4.0/obfuscate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,16 @@ const obfuscate = (_data: V4WrappedDocument, fields: string[] | string) => {

export type ObfuscateVerifiableCredentialResult<T extends V4WrappedDocument> = Override<
T,
{ credentialSubject: PartialDeep<T["credentialSubject"]> }
{
credentialSubject: Override<
PartialDeep<T["credentialSubject"]>,
{
attachments?: T["credentialSubject"]["attachments"] extends Array<unknown>
? T["credentialSubject"]["attachments"]
: undefined;
}
>;
}
>;
export const obfuscateVerifiableCredential = <T extends V4WrappedDocument | V4SignedWrappedDocument>(
document: T,
Expand Down

0 comments on commit 69bd41a

Please sign in to comment.