export function formatPastedJsonText(text: string): string | null {
  const trimmedText = text.trim();

  if (!trimmedText) {
    return null;
  }

  try {
    return JSON.stringify(JSON.parse(trimmedText) as unknown, null, 2);
  } catch {
    return null;
  }
}
