Skip to content

Commit

Permalink
🐛 Fix errorType argument type.
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Dec 13, 2021
1 parent f286481 commit 5efd606
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -573,7 +573,7 @@ wretch().defaults({ encoding: "same-origin", headers: { "X-Custom": "Header" }},
*/
```

#### errorType(method: "text" | "json" = "text")
#### errorType(method: string = "text")

Sets the method (text, json ...) used to parse the data contained in the response body in case of an HTTP error.

Expand Down
2 changes: 1 addition & 1 deletion src/wretcher.ts
Expand Up @@ -50,7 +50,7 @@ export class Wretcher {
*
* Default is "text".
*/
errorType(method: "text" | "json") {
errorType(method: string) {
conf.errorType = method
return this
}
Expand Down

0 comments on commit 5efd606

Please sign in to comment.