import type { StudioContext } from "@/core/studio-context";

export async function hasAnyObject(
  ctx: StudioContext,
  prefix: string,
): Promise<boolean> {
  const storage = ctx.objectStorage;
  if (!storage) return false;
  try {
    const result = await storage.list({ prefix, maxKeys: 1 });
    return result.objects.length > 0;
  } catch {
    return false;
  }
}
