From 10663e6aeaa15594da438833c07e110c1e2f884c Mon Sep 17 00:00:00 2001 From: Skyler Date: Thu, 16 Apr 2020 21:37:51 -0700 Subject: [PATCH] fix jsonable --- packages/runtime/runtime-definitions/src/jsonable.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/runtime/runtime-definitions/src/jsonable.ts b/packages/runtime/runtime-definitions/src/jsonable.ts index 89255ce9d560..b91dce505ba2 100644 --- a/packages/runtime/runtime-definitions/src/jsonable.ts +++ b/packages/runtime/runtime-definitions/src/jsonable.ts @@ -13,6 +13,9 @@ export type JsonableObject = { export type JsonableArray = Jsonable[]; +export type JsonablePrimitiveArrayOrObject = T | JsonableArray | JsonableObject; + + /** * Used to constrain a value to types that are serializable as JSON. The `T` type parameter may be used to * customize the type of the leaves to support situations where a `replacer` is used to handle special values. @@ -26,4 +29,8 @@ export type JsonableArray = Jsonable[]; * - Non-finite numbers (`NaN`, `+/-Infinity`) are also coerced to `null`. * - (`null` always serializes as `null`.) */ -export type Jsonable = T | JsonableArray | JsonableObject; +export type Jsonable = { + [P in keyof T]: T[P] extends JsonablePrimitiveArrayOrObject + ? T[P] + : Pick; +};