export json types in utils
https://github.com/cosmos/cosmjs/blob/ca243f58727d5d7ee0f46fc562fb816baf4fca62/packages/json-rpc/src/types.ts#L12-L16
JsonCompatibleDictionary seems like it should be used in a lot of the many places that currently use any #1840, and also seems like it should be renamed JsonObject.
I'm guessing migrating to using real json validation like zod would be overkill.
https://www.npmjs.com/package/zod
But maybe it's not needed to reinvent JsonValue if we use this:
https://www.npmjs.com/package/type-fest
Interesting, looks good at first glance
I'm guessing migrating to using real json validation like
zodwould be overkill.
Yeah, agreed. Also I don't like external libraries in our public types which makes it very hard to replace dependencies.
external libraries in our public types which makes it very hard to replace dependencies.
And even just upgrading them, zod had a whole thing about how carefully the upgrade had to be designed due to how entangled it is with APIs.
https://github.com/colinhacks/zod/issues/4371 https://zod.dev/v4
type-fest actually has its own widely adopted definition of JsonValue, package has 219 million downloads a week. Thoughts on using that in a public API?
https://github.com/sindresorhus/type-fest/blob/v5.1.0/source/json-value.d.ts https://github.com/sindresorhus/type-fest/blob/v5.1.0/source/readonly-deep.d.ts