diff options
Diffstat (limited to 'packages/browser/src')
9 files changed, 18 insertions, 18 deletions
diff --git a/packages/browser/src/helpers/base64URLStringToBuffer.ts b/packages/browser/src/helpers/base64URLStringToBuffer.ts index baa258f..f30b3d5 100644 --- a/packages/browser/src/helpers/base64URLStringToBuffer.ts +++ b/packages/browser/src/helpers/base64URLStringToBuffer.ts @@ -5,7 +5,7 @@ * * Helper method to compliment `bufferToBase64URLString` */ -export default function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { +export function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { // Convert from Base64URL to Base64 const base64 = base64URLString.replace(/-/g, '+').replace(/_/g, '/'); /** diff --git a/packages/browser/src/helpers/bufferToBase64URLString.ts b/packages/browser/src/helpers/bufferToBase64URLString.ts index c13420c..6a40cbb 100644 --- a/packages/browser/src/helpers/bufferToBase64URLString.ts +++ b/packages/browser/src/helpers/bufferToBase64URLString.ts @@ -4,7 +4,7 @@ * * Helper method to compliment `base64URLStringToBuffer` */ -export default function bufferToBase64URLString(buffer: ArrayBuffer): string { +export function bufferToBase64URLString(buffer: ArrayBuffer): string { const bytes = new Uint8Array(buffer); let str = ''; diff --git a/packages/browser/src/helpers/bufferToUTF8String.ts b/packages/browser/src/helpers/bufferToUTF8String.ts index a4b97c9..0da3246 100644 --- a/packages/browser/src/helpers/bufferToUTF8String.ts +++ b/packages/browser/src/helpers/bufferToUTF8String.ts @@ -2,6 +2,6 @@ * A helper method to convert an arbitrary ArrayBuffer, returned from an authenticator, to a UTF-8 * string. */ -export default function bufferToUTF8String(value: ArrayBuffer): string { +export function bufferToUTF8String(value: ArrayBuffer): string { return new TextDecoder('utf-8').decode(value); } diff --git a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts index 82b6ac1..d4d8103 100644 --- a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts +++ b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts @@ -1,8 +1,8 @@ import type { PublicKeyCredentialDescriptorJSON } from '@simplewebauthn/typescript-types'; -import base64URLStringToBuffer from './base64URLStringToBuffer'; +import { base64URLStringToBuffer } from './base64URLStringToBuffer'; -export default function toPublicKeyCredentialDescriptor( +export function toPublicKeyCredentialDescriptor( descriptor: PublicKeyCredentialDescriptorJSON, ): PublicKeyCredentialDescriptor { const { id } = descriptor; diff --git a/packages/browser/src/helpers/utf8StringToBuffer.ts b/packages/browser/src/helpers/utf8StringToBuffer.ts index 32cb717..b15e5fe 100644 --- a/packages/browser/src/helpers/utf8StringToBuffer.ts +++ b/packages/browser/src/helpers/utf8StringToBuffer.ts @@ -2,6 +2,6 @@ * A helper method to convert an arbitrary string sent from the server to an ArrayBuffer the * authenticator will expect. */ -export default function utf8StringToBuffer(value: string): ArrayBuffer { +export function utf8StringToBuffer(value: string): ArrayBuffer { return new TextEncoder().encode(value); } diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index b246cb0..e6ac9c7 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -7,8 +7,8 @@ import { import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/structs'; import { generateCustomError } from '../helpers/__jest__/generateCustomError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index e99629c..6bc36d7 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -4,12 +4,12 @@ import { AuthenticationCredentialJSON, } from '@simplewebauthn/typescript-types'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; -import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; -import bufferToUTF8String from '../helpers/bufferToUTF8String'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; +import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; +import { bufferToUTF8String } from '../helpers/bufferToUTF8String'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; -import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; +import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyAuthenticationError } from '../helpers/identifyAuthenticationError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts index ddc2d6a..1ca9e62 100644 --- a/packages/browser/src/methods/startRegistration.test.ts +++ b/packages/browser/src/methods/startRegistration.test.ts @@ -6,11 +6,11 @@ import { } from '@simplewebauthn/typescript-types'; import { generateCustomError } from '../helpers/__jest__/generateCustomError'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/structs'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; import { startRegistration } from './startRegistration'; diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index c9749b1..f809405 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -4,11 +4,11 @@ import { RegistrationCredentialJSON, } from '@simplewebauthn/typescript-types'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; -import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; +import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; -import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; +import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyRegistrationError } from '../helpers/identifyRegistrationError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; |