mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
fix: AxiosHeaders toJSON() return types (#10956)
* fix(types): fix AxiosHeaders `toJSON` types; * Apply suggestion from @cubic-dev-ai[bot] Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix(types): add a boolean catch-all overload; --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2161,7 +2161,8 @@ Returns a new `AxiosHeaders` instance.
|
||||
### AxiosHeaders#toJSON(asStrings?)
|
||||
|
||||
```
|
||||
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||
toJSON(asStrings: true): Record<string, string>;
|
||||
toJSON(asStrings?: false): Record<string, string | string[]>;
|
||||
```
|
||||
|
||||
Resolve all internal header values into a new null prototype object.
|
||||
|
||||
+3
-1
@@ -66,7 +66,9 @@ declare class AxiosHeaders {
|
||||
...targets: Array<AxiosHeaders | axios.RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
toJSON(asStrings?: boolean): axios.RawAxiosHeaders;
|
||||
toJSON(asStrings: true): Record<string, string>;
|
||||
toJSON(asStrings?: false): Record<string, string | string[]>;
|
||||
toJSON(asStrings?: boolean): Record<string, string | string[]>;
|
||||
|
||||
static from(thing?: AxiosHeaders | axios.RawAxiosHeaders | string): AxiosHeaders;
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -47,7 +47,9 @@ export class AxiosHeaders {
|
||||
...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>
|
||||
): AxiosHeaders;
|
||||
|
||||
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||
toJSON(asStrings: true): Record<string, string>;
|
||||
toJSON(asStrings?: false): Record<string, string | string[]>;
|
||||
toJSON(asStrings?: boolean): Record<string, string | string[]>;
|
||||
|
||||
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user