From db0a7e03dee394bf2243d6824e9ae3415bc645c9 Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Tue, 10 Oct 2023 22:10:54 -0400 Subject: [PATCH] formatting --- packages/remix-server-runtime/serialize.ts | 34 +++++++++++++--------- packages/remix-server-runtime/typecheck.ts | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/remix-server-runtime/serialize.ts b/packages/remix-server-runtime/serialize.ts index d95a7bf6c79..4a2a8a3a79c 100644 --- a/packages/remix-server-runtime/serialize.ts +++ b/packages/remix-server-runtime/serialize.ts @@ -17,21 +17,27 @@ export type SerializeFrom = ; // note: cannot be inlined as logic requires union distribution -type Serialize = Output extends TypedDeferredData - ? // top-level promises - { - [K in keyof U as K extends symbol - ? never - : Promise extends U[K] - ? K - : never]: DeferValue; // use generic to distribute over union - } & Jsonify<{ - // non-promises - [K in keyof U as Promise extends U[K] ? never : K]: U[K]; +// prettier-ignore +type Serialize = + Output extends TypedDeferredData ? + // top-level promises + & { + [K in keyof U as + K extends symbol ? never : + Promise extends U[K] ? K : + never + ]: DeferValue; // use generic to distribute over union + } + // non-promises + & Jsonify<{ + [K in keyof U as + Promise extends U[K] ? never : + K + ]: U[K]; }> - : Output extends TypedResponse - ? Jsonify - : Jsonify; + : + Output extends TypedResponse ? Jsonify : + Jsonify; // prettier-ignore type DeferValue = diff --git a/packages/remix-server-runtime/typecheck.ts b/packages/remix-server-runtime/typecheck.ts index eff68677690..7f6ffeab236 100644 --- a/packages/remix-server-runtime/typecheck.ts +++ b/packages/remix-server-runtime/typecheck.ts @@ -1,6 +1,6 @@ // typecheck that expression is assignable to type - export function expectType(_expression: T) {} + // prettier-ignore // adapted from https://github.com/type-challenges/type-challenges/blob/main/utils/index.d.ts export type Equal =