summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/parseAuthenticatorData.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-12-10 08:19:39 -0800
committerMatthew Miller <matthew@millerti.me>2020-12-10 08:19:39 -0800
commite444fa4a0b98cf1e5ba325424b3c04878660c317 (patch)
treeed49510bf0aca5cf6a101f07d5220e427baa62c1 /packages/server/src/helpers/parseAuthenticatorData.ts
parent4e438d3437ce2d15c903d6ea1a404f1fd652fc8e (diff)
Fix an unexpected server package build issue
I have no idea why TypeScript started complaining about the return value of cbor.encode() here, nothing in this branch touches the server package and the last CI run before this branch passed just fine. Return type is `Buffer | ArrayBufferView` so I went with `ArrayBuffer`.
Diffstat (limited to 'packages/server/src/helpers/parseAuthenticatorData.ts')
-rw-r--r--packages/server/src/helpers/parseAuthenticatorData.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/helpers/parseAuthenticatorData.ts b/packages/server/src/helpers/parseAuthenticatorData.ts
index 67f0e1a..cce6756 100644
--- a/packages/server/src/helpers/parseAuthenticatorData.ts
+++ b/packages/server/src/helpers/parseAuthenticatorData.ts
@@ -52,7 +52,7 @@ export default function parseAuthenticatorData(authData: Buffer): ParsedAuthenti
// Decode the next CBOR item in the buffer, then re-encode it back to a Buffer
const firstDecoded = decodeCborFirst(intBuffer);
- const firstEncoded = Buffer.from(cbor.encode(firstDecoded));
+ const firstEncoded = Buffer.from(cbor.encode(firstDecoded) as ArrayBuffer);
credentialPublicKey = firstEncoded;
intBuffer = intBuffer.slice(firstEncoded.byteLength);
}
@@ -60,7 +60,7 @@ export default function parseAuthenticatorData(authData: Buffer): ParsedAuthenti
let extensionsDataBuffer: Buffer | undefined = undefined;
if (flags.ed) {
const firstDecoded = decodeCborFirst(intBuffer);
- const firstEncoded = Buffer.from(cbor.encode(firstDecoded));
+ const firstEncoded = Buffer.from(cbor.encode(firstDecoded) as ArrayBuffer);
extensionsDataBuffer = firstEncoded;
intBuffer = intBuffer.slice(firstEncoded.byteLength);
}