Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
468 B
Raw Blame
type UseCasePageLike = {
  slugs: readonly string[];
};

function pageKey(page: UseCasePageLike): string {
  return page.slugs.join("/");
}

export function mergeUseCasePagesWithEnglishFallback<
  TPage extends UseCasePageLike,
>(localizedPages: TPage[], englishPages: TPage[]): TPage[] {
  const localizedSlugs = new Set(localizedPages.map(pageKey));

  return [
    ...localizedPages,
    ...englishPages.filter((page) => !localizedSlugs.has(pageKey(page))),
  ];
}