-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: handle credential_types check when using default (#197)
Co-authored-by: Paolo <[email protected]>
- Loading branch information
Showing
7 changed files
with
38 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { CredentialType } from '..' | ||
import type { IDKitConfig } from '..' | ||
import { Buffer } from 'buffer/index.js' | ||
|
||
export const DEFAULT_CREDENTIAL_TYPES = [CredentialType.Orb] | ||
|
||
export const buffer_encode = (buffer: ArrayBuffer): string => { | ||
return Buffer.from(buffer).toString('base64') | ||
} | ||
|
||
export const buffer_decode = (encoded: string): ArrayBuffer => { | ||
return Buffer.from(encoded, 'base64') | ||
} | ||
|
||
export const credential_types_or_default = (credential_types: IDKitConfig['credential_types']): CredentialType[] => { | ||
return credential_types?.length ? credential_types : DEFAULT_CREDENTIAL_TYPES | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters