diff options
author | Matthew Miller <matthew@millerti.me> | 2020-05-19 01:04:26 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-05-19 01:04:26 -0700 |
commit | 2f5ecb1e7fcafbf5bca9009bea9f06c59703788d (patch) | |
tree | 25a20bc422c70e630b3e134bcd6d3bc83a2e960e /src/helpers/decodeAttestationObject.ts | |
parent | 1af9b98d689d623e4ecc9593d24cbb8621120222 (diff) |
Clarify usage of decodeAttestationObject
Diffstat (limited to 'src/helpers/decodeAttestationObject.ts')
-rw-r--r-- | src/helpers/decodeAttestationObject.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/helpers/decodeAttestationObject.ts b/src/helpers/decodeAttestationObject.ts index 1c353d9..c54a69a 100644 --- a/src/helpers/decodeAttestationObject.ts +++ b/src/helpers/decodeAttestationObject.ts @@ -4,11 +4,14 @@ import cbor from 'cbor'; import { AttestationObject } from '@types'; /** + * Convert an AttestationObject from base64 string to a proper object * - * @param obj + * @param base64AttestationObject Base64-encoded Attestation Object */ -export default function decodeAttestationObject(obj: string): AttestationObject { - const toBuffer = base64url.toBuffer(obj); - const toCBOR = cbor.decodeAllSync(toBuffer)[0]; +export default function decodeAttestationObject( + base64AttestationObject: string, +): AttestationObject { + const toBuffer = base64url.toBuffer(base64AttestationObject); + const toCBOR: AttestationObject = cbor.decodeAllSync(toBuffer)[0]; return toCBOR; } |