#269 brought to my attention that #65 changed the JsonObject
so that all keys are marked as optional.
Before TypeScript 4.4 a { foo?: string}
and a { foo?: string|undefined }
was always treated as equal, so #65 made sense then.
But with TS 4.4 the new --exactOptionalPropertyTypes
config was introduced, which (correctly )no longer treats { foo?: string}
as equal to { foo?: string|undefined }
.
For some reason though, the change introduced in #65 still gets treated in the old way:
Line 22 in 6b6d81c
I would propose reverting #65 and moving back to:
export type JsonObject = {[key: string]: JsonValue};
I think it behaves more correctly, as can be seen in this playground.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too