export function settled<T>(res: PromiseSettledResult<unknown> | undefined): T | null {
	if (res?.status !== 'fulfilled') return null;
	const v = res.value as { response: Response; data: unknown } | null;
	return v?.response?.ok ? ((v.data as T) ?? null) : null;
}
