JA
ベータ版の翻訳

@core / comments

1.0.1 ▾
認証済みMIT
GitHub

任意のエンティティへのモデレーション付きコメント:ゲスト/ユーザー、返信、1〜5 評価、ブロック、GDPR 削除、安全な HTML

コード9 ファイルコンテキスト約 552 トークンスキャン合格

.genpmignore 適用後に組み込まれる正確なツリーです。固定先:

src/lib/comments/adapters/next.ts読み取り専用 · abfbbe8
// Adaptador Next.js: `app/api/comments/[type]/[id]/route.ts` →
//   export const { GET, POST } = commentRoute({ currentUser: async () => getUser(await cookies()) });
import type { Moderation } from '../index.ts';
import { type CurrentUser, handleList, handlePost } from './http.ts';

type Ctx = { params: Promise<{ type: string; id: string }> };

export function commentRoute(opts: { currentUser: CurrentUser; moderation?: Moderation }) {
  return {
    GET: async (req: Request, ctx: Ctx) => {
      const { type, id } = await ctx.params;
      return handleList(req, type, id);
    },
    POST: async (req: Request, ctx: Ctx) => {
      const { type, id } = await ctx.params;
      return handlePost(req, type, id, opts);
    },
  };
}

@core/comments を報告

パッケージを報告するには GitHub でログインしてください。

GitHub で続ける