vagar

A Small TypeScript Pattern

This placeholder explores a tiny typed helper. The implementation is intentionally ordinary so the rendered code is easy to inspect while tuning typography and syntax colors.

type Post = {
  title: string;
  publishedAt: Date;
};

const sortNewestFirst = (posts: Post[]) =>
  [...posts].sort((left, right) => right.publishedAt.valueOf() - left.publishedAt.valueOf());

A command-line example can be represented with a shell fence:

bun run build
bun run preview

And structured data can use JSON highlighting:

{
  "title": "A small placeholder",
  "draft": true,
  "tags": ["astro", "typescript"]
}