Skip to content

Commit

Permalink
Allow all keys to be optional in the JsonObject type (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
yxliang01 committed Feb 14, 2020
1 parent 8a908a3 commit 6c105fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/basic.d.ts
Expand Up @@ -40,7 +40,7 @@ Matches a JSON object.
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
*/
export type JsonObject = {[key: string]: JsonValue};
export type JsonObject = {[Key in string]?: JsonValue};

/**
Matches a JSON array.
Expand Down

0 comments on commit 6c105fb

Please sign in to comment.