Jiseoup/showmycodePublic
EN|KO
  • Code
  • Commits
  • Pull Requests
← Back to list

refactor: replace JSDoc comments with single-line comments

JiseoupJiseoup · Jun 15, 202604c514e

Files changed2+6 -6

Changed files

+6 -6 · 2

@@ -2,13 +2,13 @@ import Link from "next/link";
import type { Locale } from "@/lib/i18n.server";
type Props = {
- /** Locale segment the home link should point to. */
+ // Locale segment the home link should point to.
locale: Locale;
- /** Text shown next to the logo (site name on home, owner on repo pages). */
+ // Text shown next to the logo (site name on home, owner on repo pages).
label: string;
};
-/** GitHub logo + label linking back to the home page, focused as a single unit. */
+// GitHub logo + label linking back to the home page, focused as a single unit.
export function BrandLink({ locale, label }: Props) {
return (
<Link
@@ -14,17 +14,17 @@ function safeEqual(a: string, b: string): boolean {
return timingSafeEqual(Buffer.from(a), Buffer.from(b));
}
-/** Constant-time comparison of a submitted token against the expected SHARE_TOKEN. */
+// Constant-time comparison of a submitted token against the expected SHARE_TOKEN.
export function verifyToken(submitted: string, expected: string): boolean {
return safeEqual(submitted, expected);
}
-/** Value to store in the auth cookie (HMAC of the token, not the raw token). */
+// Value to store in the auth cookie (HMAC of the token, not the raw token).
export function cookieValue(token: string): string {
return hmacSign(token);
}
-/** Check whether a cookie value is valid for the given SHARE_TOKEN. */
+// Check whether a cookie value is valid for the given SHARE_TOKEN.
export function verifyCookie(value: string, token: string): boolean {
return safeEqual(value, hmacSign(token));
}