Skip to content

Commit

Permalink
Ignore internals from docs output
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Dec 8, 2024
1 parent acdd00b commit 652472e
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 9 deletions.
5 changes: 4 additions & 1 deletion packages/browser/src/helpers/browserSupportsWebAuthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export function browserSupportsWebAuthn(): boolean {
);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _browserSupportsWebAuthnInternals = {
stubThis: (value: boolean) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/decodeAttestationObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export type AttestationStatement = {
readonly size: number;
};

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _decodeAttestationObjectInternals = {
stubThis: (value: AttestationObject) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/decodeClientDataJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export type ClientDataJSON = {
};
};

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _decodeClientDataJSONInternals = {
stubThis: (value: ClientDataJSON) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/decodeCredentialPublicKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export function decodeCredentialPublicKey(
);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _decodeCredentialPublicKeyInternals = {
stubThis: (value: COSEPublicKey) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export function fetch(url: string): Promise<Response> {
return _fetchInternals.stubThis(url);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _fetchInternals = {
stubThis: (url: string) => crossFetch(url),
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/generateChallenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export async function generateChallenge(): Promise<Uint8Array> {
return _generateChallengeInternals.stubThis(challenge);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _generateChallengeInternals = {
stubThis: (value: Uint8Array) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/generateUserID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export async function generateUserID(): Promise<Uint8Array> {
return _generateUserIDInternals.stubThis(newUserID);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _generateUserIDInternals = {
stubThis: (value: Uint8Array) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/parseAuthenticatorData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ export type ParsedAuthenticatorData = {
extensionsDataBuffer?: Uint8Array;
};

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _parseAuthenticatorDataInternals = {
stubThis: (value: ParsedAuthenticatorData) => value,
};
5 changes: 4 additions & 1 deletion packages/server/src/helpers/verifySignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export function verifySignature(opts: {
);
}

// Make it possible to stub the return value during testing
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export const _verifySignatureInternals = {
stubThis: (value: Promise<boolean>) => value,
};

0 comments on commit 652472e

Please sign in to comment.