style: format server and shared with prettier

A mechanical prettier --write over server/src, server/tests, server/scripts
and shared/src with the workspaces' .prettierrc; nothing but layout and
import order changes, and every file keeps the same set of imports. shared
is formatted throughout and its format baseline is empty. The server
baseline keeps the 35 files that Prettier would grow past their lint:size
limit (they need a split first, which is not a formatting change), and the
generated entity files stay as their generator writes them.
This commit is contained in:
Maurice
2026-10-10 21:23:37 +02:00
parent f4e518b2df
commit 724c88c201
1978 changed files with 78448 additions and 39347 deletions
+9 -3
View File
@@ -51,7 +51,7 @@ export async function readCappedJson<T>(res: CappedResponse, maxBytes: number):
// Neither a stream nor text() means there is nothing to read incrementally
// and nothing to cap — a null-body status, or a partial stub in a test.
if (!res.body?.getReader && !res.text && !res.arrayBuffer && res.json) {
return await res.json() as T;
return (await res.json()) as T;
}
const { text, truncated } = await readCappedText(res, maxBytes);
if (truncated) return undefined;
@@ -69,7 +69,10 @@ export async function readCappedJson<T>(res: CappedResponse, maxBytes: number):
* degrade to whatever they find. Responses without a stream fall back to
* arrayBuffer(), which is post-checked instead.
*/
export async function readCapped(res: CappedResponse, maxBytes: number): Promise<{ bytes: Buffer; truncated: boolean }> {
export async function readCapped(
res: CappedResponse,
maxBytes: number,
): Promise<{ bytes: Buffer; truncated: boolean }> {
const reader = res.body?.getReader();
if (!reader) {
const raw = res.arrayBuffer ? Buffer.from(await res.arrayBuffer()) : Buffer.from(res.text ? await res.text() : '');
@@ -102,7 +105,10 @@ export async function readCapped(res: CappedResponse, maxBytes: number): Promise
* stream it reads text() directly instead of going through readCapped, which
* prefers arrayBuffer().
*/
export async function readCappedText(res: CappedResponse, maxBytes: number): Promise<{ text: string; truncated: boolean }> {
export async function readCappedText(
res: CappedResponse,
maxBytes: number,
): Promise<{ text: string; truncated: boolean }> {
if (!res.body?.getReader && res.text) {
const raw = Buffer.from(await res.text(), 'utf8');
return raw.length > maxBytes