Closed gajus closed 3 years ago
JsonObject that comes from 'type-fest' (annoyingly) includes undefined as valid value, which is not the case for json.
JsonObject
A better definition would be:
type JsonObject = { [key: string]: JsonValue, }; type JsonValue = JsonObject | JsonValue[] | boolean | number | string | null;
JsonObject that comes from 'type-fest' (annoyingly) includes undefined as valid value
It does not. It allows optional keys. You might want to use the exactOptionalPropertyTypes flag.
exactOptionalPropertyTypes
Context: https://github.com/sindresorhus/type-fest/pull/65
JsonObject
that comes from 'type-fest' (annoyingly) includes undefined as valid value, which is not the case for json.A better definition would be: