Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improv(client): Return JsonValue type #2602

Merged
merged 4 commits into from May 29, 2020
Merged

improv(client): Return JsonValue type #2602

merged 4 commits into from May 29, 2020

Conversation

Jolg42
Copy link
Member

@Jolg42 Jolg42 commented May 29, 2020

@Jolg42 Jolg42 requested a review from timsuchanek May 29, 2020 10:37
@Jolg42 Jolg42 added this to the Beta 7 milestone May 29, 2020
@timsuchanek timsuchanek merged commit fae04e5 into master May 29, 2020
@timsuchanek timsuchanek deleted the pr/json-type branch May 29, 2020 15:41
@@ -157,7 +157,7 @@ declare interface JsonArray extends Array<JsonValue> {}
* From https://github.com/sindresorhus/type-fest/
* Matches any valid JSON value.
*/
declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray
declare type JsonValue = string | number | boolean | null | Date | JsonObject | JsonArray
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you guys convert Dates? Its not a JSON primitive.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mention this here as well prisma/prisma-client-js#691 but this breaks the JSON specification. It gives TypeScript errors when trying to send the value through an API that encodes/decodes to JSON like Next.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants