MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / normalizeBluesky

Function normalizeBluesky

api/src/utils/normalize.ts:49–61  ·  view source on GitHub ↗
(
  handleOrUrl: string | null
)

Source from the content-addressed store, hash-verified

47 * @returns Bluesky URL.
48 */
49export const normalizeBluesky = (
50 handleOrUrl: string | null
51): string | undefined => {
52 if (!handleOrUrl) return undefined;
53
54 let url;
55 try {
56 new URL(handleOrUrl);
57 } catch {
58 url = `https://bsky.app/profile/${handleOrUrl.replace(/^@/, '')}`;
59 }
60 return url ?? handleOrUrl;
61};
62
63/**
64 * Normalizes a date value to a timestamp number.

Callers 3

normalize.test.tsFile · 0.85
userPublicGetRoutesFunction · 0.85
getSessionUserHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected