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 =