Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): data matcher for body and query. (#1725)
* fix(types): data matcher for body and query. Fixes: #1724 Closes: #1723 Updates the JSONish type using inspiration from the thread on adding a JSON type to TS. microsoft/TypeScript#1897 (comment) This change does a couple sublet things: - Adds `undefined` to scalar values allowed in arrays or as values in objects. This allows for interfaces with optional keys to be passed in. ref #1723 - Splits out top-level array and objects into their interfaces so they could be used directly. Allows enforcing non-arrays for `.query`. - `RequestBodyMatcher` now extends the array and map types instead of the raw `DataMatcher`. Allowing arrays fixes #1724. This also ensures that booleans, numbers, and `null` are not considered valid.
- Loading branch information
1 parent
6b88dff
commit 59b345c
Showing
2 changed files
with
37 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters