@hyper-fetch/axios 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +6 -0
- package/README.md +72 -0
- package/__tests__/features/adapter/adapter.spec.ts +91 -0
- package/__tests__/global.d.ts +1 -0
- package/__tests__/jest.setup.ts +5 -0
- package/__tests__/server/index.ts +2 -0
- package/__tests__/server/server.constants.ts +18 -0
- package/__tests__/server/server.ts +48 -0
- package/__tests__/server/server.utils.ts +106 -0
- package/__tests__/tsconfig.json +10 -0
- package/coverage/clover.xml +73 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/lcov-report/adapter.server.ts.html +223 -0
- package/coverage/lcov-report/adapter.ts.html +277 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +116 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +97 -0
- package/dist/index.cjs.js +123 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.esm.js +98 -0
- package/dist/index.esm.js.map +7 -0
- package/jest.config.ts +30 -0
- package/package.json +57 -0
- package/project.json +3 -0
- package/src/adapter/adapter.ts +64 -0
- package/src/adapter/adapter.types.ts +19 -0
- package/src/adapter/index.ts +2 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +12 -0
package/.eslintrc.json
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ๐๏ธ Hyper Fetch Axios
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://bettertyped.com/">
|
|
5
|
+
<img src="https://custom-icon-badges.demolab.com/static/v1?label=&message=BetterTyped&color=333&logo=BT" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
8
|
+
<img src="https://custom-icon-badges.demolab.com/github/stars/BetterTyped/hyper-fetch?logo=star&color=118ab2" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://github.com/BetterTyped/hyper-fetch/blob/main/License.md">
|
|
11
|
+
<img src="https://custom-icon-badges.demolab.com/github/license/BetterTyped/hyper-fetch?logo=law&color=yellow" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@hyper-fetch/graphql">
|
|
14
|
+
<img src="https://custom-icon-badges.demolab.com/npm/v/@hyper-fetch/graphql.svg?logo=npm&color=e76f51" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage">
|
|
17
|
+
<img src="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
20
|
+
<img src="https://custom-icon-badges.demolab.com/badge/typescript-%23007ACC.svg?logo=typescript&logoColor=white" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
23
|
+
<img src="https://custom-icon-badges.demolab.com/badge/-Axios-E10098?logo=axios&logoColor=white" />
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://www.npmjs.com/package/@hyper-fetch/axios">
|
|
26
|
+
<img src="https://custom-icon-badges.demolab.com/bundlephobia/minzip/@hyper-fetch/axios?color=64BC4B&logo=package" />
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
## About
|
|
31
|
+
|
|
32
|
+
**`Hyper Fetch Axios`** is adapter for Hyper Fetch. It enables seamless communication with Axios, simplifying the
|
|
33
|
+
retrieval and manipulation of data. Benefit from the convenience and efficiency of Hyper Fetch.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
๐ฎ **Simple setup** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/basic/setup)
|
|
38
|
+
|
|
39
|
+
๐ฏ **Request cancellation** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/cancellation)
|
|
40
|
+
|
|
41
|
+
โจ **Window Focus/Blur Events** -
|
|
42
|
+
[Read more](https://hyperfetch.bettertyped.com/docs/guides/react/core/window-focus-blur)
|
|
43
|
+
|
|
44
|
+
๐ **Queueing** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/queueing)
|
|
45
|
+
|
|
46
|
+
๐ **Automatic caching** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/core/cache)
|
|
47
|
+
|
|
48
|
+
๐ช **Persistence** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/persistence)
|
|
49
|
+
|
|
50
|
+
๐ **SSR Support** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/environment)
|
|
51
|
+
|
|
52
|
+
๐ **Offline First** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/offline)
|
|
53
|
+
|
|
54
|
+
๐ก **Built-in adapter** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/core/adapter)
|
|
55
|
+
|
|
56
|
+
๐งช **Easy to test** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/testing)
|
|
57
|
+
|
|
58
|
+
๐ **Authentication** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/basic/authentication)
|
|
59
|
+
|
|
60
|
+
๐ก **Prefetching** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/prefetching)
|
|
61
|
+
|
|
62
|
+
## Help us keep working on this project โค๏ธ
|
|
63
|
+
|
|
64
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/prc5)
|
|
65
|
+
|
|
66
|
+
## Sources
|
|
67
|
+
|
|
68
|
+
- #### [Installation](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/installation)
|
|
69
|
+
- #### [Docs](https://hyperfetch.bettertyped.com/)
|
|
70
|
+
- #### [API](https://hyperfetch.bettertyped.com/api/)
|
|
71
|
+
- #### [NPM](https://www.npmjs.com/package/@hyper-fetch/graphql)
|
|
72
|
+
- #### [Guides](https://hyperfetch.bettertyped.com/guides/Basic/Setup)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Client } from "@hyper-fetch/core";
|
|
2
|
+
|
|
3
|
+
import { axiosAdapter } from "../../../src/adapter/adapter";
|
|
4
|
+
import { createRequestInterceptor, resetInterceptors, startServer, stopServer } from "../../server";
|
|
5
|
+
|
|
6
|
+
describe("Fetch Adapter [ Browser ]", () => {
|
|
7
|
+
let client = new Client({ url: "shared-base-url" }).setAdapter(axiosAdapter);
|
|
8
|
+
let request = client.createRequest()({ endpoint: "/shared-endpoint" });
|
|
9
|
+
|
|
10
|
+
beforeAll(() => {
|
|
11
|
+
startServer();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
client = new Client({ url: "shared-base-url" }).setAdapter(axiosAdapter);
|
|
16
|
+
request = client.createRequest()({ endpoint: "/shared-endpoint" });
|
|
17
|
+
|
|
18
|
+
resetInterceptors();
|
|
19
|
+
jest.resetAllMocks();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
afterAll(() => {
|
|
23
|
+
stopServer();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should make a request and return success data with status", async () => {
|
|
27
|
+
const response = createRequestInterceptor(request);
|
|
28
|
+
const { data, status, error, extra } = await request.send();
|
|
29
|
+
|
|
30
|
+
expect(data).toStrictEqual(response);
|
|
31
|
+
expect(status).toBe(200);
|
|
32
|
+
expect(error).toBe(null);
|
|
33
|
+
expect({ ...extra.headers }).toStrictEqual({
|
|
34
|
+
"content-type": "application/json",
|
|
35
|
+
"x-powered-by": "msw",
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("should make a request and return error with status", async () => {
|
|
40
|
+
createRequestInterceptor(request, { status: 400 });
|
|
41
|
+
const { data, error, status, extra } = await request.send();
|
|
42
|
+
|
|
43
|
+
expect(error.message).toBe("Request failed with status code 400");
|
|
44
|
+
expect(data).toStrictEqual(null);
|
|
45
|
+
expect(status).toBe(400);
|
|
46
|
+
expect({ ...extra.headers }).toStrictEqual({
|
|
47
|
+
"content-type": "application/json",
|
|
48
|
+
"x-powered-by": "msw",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should allow to call the request callbacks", async () => {
|
|
53
|
+
createRequestInterceptor(request);
|
|
54
|
+
|
|
55
|
+
const spy1 = jest.fn();
|
|
56
|
+
const spy2 = jest.fn();
|
|
57
|
+
const spy3 = jest.fn();
|
|
58
|
+
const spy4 = jest.fn();
|
|
59
|
+
const spy5 = jest.fn();
|
|
60
|
+
const spy6 = jest.fn();
|
|
61
|
+
|
|
62
|
+
await request.send({
|
|
63
|
+
onSettle: spy1,
|
|
64
|
+
onRequestStart: spy2,
|
|
65
|
+
onResponseStart: spy3,
|
|
66
|
+
onUploadProgress: spy4,
|
|
67
|
+
onDownloadProgress: spy5,
|
|
68
|
+
onResponse: spy6,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
expect(spy1).toBeCalledTimes(1);
|
|
72
|
+
expect(spy2).toBeCalledTimes(1);
|
|
73
|
+
expect(spy3).toBeCalledTimes(1);
|
|
74
|
+
expect(spy4).toBeCalledTimes(2);
|
|
75
|
+
expect(spy5).toBeCalledTimes(3);
|
|
76
|
+
expect(spy6).toBeCalledTimes(1);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("should allow to add upload progress", async () => {
|
|
80
|
+
const postRequest = client.createRequest<any, any>()({ endpoint: "/shared-endpoint", method: "POST" });
|
|
81
|
+
createRequestInterceptor(postRequest);
|
|
82
|
+
|
|
83
|
+
const spy1 = jest.fn();
|
|
84
|
+
await postRequest.send({
|
|
85
|
+
data: { name: "test" },
|
|
86
|
+
onUploadProgress: spy1,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expect(spy1).toBeCalledTimes(1);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "jest-extended";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StatusCodesType = 200 | StatusErrorCodesType;
|
|
2
|
+
export type StatusErrorCodesType = 400 | 401 | 404 | 500;
|
|
3
|
+
export type ErrorMockType = { message: string };
|
|
4
|
+
|
|
5
|
+
export const errorResponses: Record<StatusErrorCodesType, ErrorMockType> = {
|
|
6
|
+
401: {
|
|
7
|
+
message: "Unathorized",
|
|
8
|
+
},
|
|
9
|
+
400: {
|
|
10
|
+
message: "Error",
|
|
11
|
+
},
|
|
12
|
+
404: {
|
|
13
|
+
message: "Not found",
|
|
14
|
+
},
|
|
15
|
+
500: {
|
|
16
|
+
message: "Server Error",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { setupServer } from "msw/node";
|
|
2
|
+
import { RequestInstance } from "request";
|
|
3
|
+
import { ExtractResponseType } from "@hyper-fetch/core";
|
|
4
|
+
|
|
5
|
+
import { getInterceptEndpoint, createStubMethod } from "./server.utils";
|
|
6
|
+
import { ErrorMockType, errorResponses, StatusCodesType, StatusErrorCodesType } from "./server.constants";
|
|
7
|
+
|
|
8
|
+
export const server = setupServer();
|
|
9
|
+
|
|
10
|
+
export const startServer = (): void => {
|
|
11
|
+
server.listen();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const resetInterceptors = (): void => {
|
|
15
|
+
server.resetHandlers();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const stopServer = (): void => {
|
|
19
|
+
server.close();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const createRequestInterceptor = <T extends RequestInstance, StatusType extends StatusCodesType>(
|
|
23
|
+
request: T,
|
|
24
|
+
props?: {
|
|
25
|
+
fixture?: ExtractResponseType<T>;
|
|
26
|
+
status?: StatusType;
|
|
27
|
+
delay?: number;
|
|
28
|
+
},
|
|
29
|
+
): StatusType extends StatusErrorCodesType ? ErrorMockType : ExtractResponseType<T> => {
|
|
30
|
+
const { fixture, status, delay } = props || {};
|
|
31
|
+
const { endpoint, method } = request;
|
|
32
|
+
const url = getInterceptEndpoint(endpoint);
|
|
33
|
+
|
|
34
|
+
const currentStatus: StatusCodesType = status || 200;
|
|
35
|
+
|
|
36
|
+
if (currentStatus !== 200 && currentStatus in errorResponses) {
|
|
37
|
+
const errorResponse = errorResponses[currentStatus] as StatusType extends StatusErrorCodesType
|
|
38
|
+
? ErrorMockType
|
|
39
|
+
: ExtractResponseType<T>;
|
|
40
|
+
server.use(createStubMethod(request, url, method, currentStatus, errorResponse, delay));
|
|
41
|
+
|
|
42
|
+
return errorResponse;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const responseData = (fixture || { data: [1, 2, 3] }) as ExtractResponseType<T>;
|
|
46
|
+
server.use(createStubMethod(request, url, method, currentStatus, responseData, delay));
|
|
47
|
+
return responseData as any;
|
|
48
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultBodyType,
|
|
3
|
+
MockedResponse,
|
|
4
|
+
PathParams,
|
|
5
|
+
ResponseComposition,
|
|
6
|
+
ResponseTransformer,
|
|
7
|
+
rest,
|
|
8
|
+
RestContext,
|
|
9
|
+
RestHandler,
|
|
10
|
+
RestRequest,
|
|
11
|
+
} from "msw";
|
|
12
|
+
import { RequestInstance } from "request";
|
|
13
|
+
|
|
14
|
+
export function sleep(timeMs) {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
setTimeout(resolve, timeMs);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const defaultTimeout = 5000;
|
|
21
|
+
export const getErrorMessage = (errorCase?: "timeout" | "abort" | "deleted") => {
|
|
22
|
+
if (errorCase === "timeout") {
|
|
23
|
+
return new Error("Request timeout");
|
|
24
|
+
}
|
|
25
|
+
if (errorCase === "abort") {
|
|
26
|
+
return new Error("Request cancelled");
|
|
27
|
+
}
|
|
28
|
+
return new Error("Unexpected error");
|
|
29
|
+
};
|
|
30
|
+
export const getInterceptEndpoint = (endpoint: string): RegExp => {
|
|
31
|
+
return new RegExp(`^(?!.*\b${`${endpoint}/`}/\b).*${endpoint}.*`);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getResponse = (ctx: RestContext, request: RequestInstance, fixture: unknown, status: number, delay = 10) => {
|
|
35
|
+
const { requestManager } = request.client;
|
|
36
|
+
const controllers = requestManager.abortControllers.get(request.abortKey);
|
|
37
|
+
const abortController = Array.from(controllers || [])[controllers.size - 1];
|
|
38
|
+
|
|
39
|
+
const timeoutTime = request.options?.timeout || defaultTimeout;
|
|
40
|
+
const isTimeout = timeoutTime < delay;
|
|
41
|
+
|
|
42
|
+
if (!delay) {
|
|
43
|
+
return [ctx.json(fixture), ctx.status(status)];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return [
|
|
47
|
+
async (response: MockedResponse<unknown>) => {
|
|
48
|
+
await sleep(Math.min(timeoutTime, delay));
|
|
49
|
+
if (abortController && abortController?.[1].signal.aborted) {
|
|
50
|
+
ctx.status(500)(response);
|
|
51
|
+
const error = getErrorMessage("abort");
|
|
52
|
+
response.body = request.client.appManager.isBrowser ? error : JSON.stringify({ message: error.message });
|
|
53
|
+
return response;
|
|
54
|
+
}
|
|
55
|
+
if (isTimeout) {
|
|
56
|
+
ctx.status(500)(response);
|
|
57
|
+
const error = getErrorMessage("timeout");
|
|
58
|
+
response.body = request.client.appManager.isBrowser ? error : JSON.stringify({ message: error.message });
|
|
59
|
+
return response;
|
|
60
|
+
}
|
|
61
|
+
ctx.json(fixture)(response);
|
|
62
|
+
ctx.status(status)(response);
|
|
63
|
+
return response;
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const createStubMethod = (
|
|
69
|
+
request: RequestInstance,
|
|
70
|
+
url: RegExp,
|
|
71
|
+
method: string,
|
|
72
|
+
status: number,
|
|
73
|
+
response: Record<string, any>,
|
|
74
|
+
delay?: number,
|
|
75
|
+
): RestHandler => {
|
|
76
|
+
function callback(_req: RestRequest<DefaultBodyType, PathParams>, res: ResponseComposition<any>, ctx: RestContext) {
|
|
77
|
+
const args: ResponseTransformer<any, any>[] = getResponse(ctx, request, response, status, delay);
|
|
78
|
+
|
|
79
|
+
if (delay === 0) {
|
|
80
|
+
args.shift();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (delay === null || delay === undefined) {
|
|
84
|
+
args.unshift(ctx.delay());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (delay) {
|
|
88
|
+
args.unshift(ctx.delay(delay));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return res(...args);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
switch (method.toUpperCase()) {
|
|
95
|
+
case "POST":
|
|
96
|
+
return rest.post(url, callback);
|
|
97
|
+
case "PUT":
|
|
98
|
+
return rest.put(url, callback);
|
|
99
|
+
case "PATCH":
|
|
100
|
+
return rest.patch(url, callback);
|
|
101
|
+
case "DELETE":
|
|
102
|
+
return rest.delete(url, callback);
|
|
103
|
+
default:
|
|
104
|
+
return rest.get(url, callback);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<coverage generated="1686218956973" clover="3.2.0">
|
|
3
|
+
<project timestamp="1686218956973" name="All files">
|
|
4
|
+
<metrics statements="64" coveredstatements="62" conditionals="16" coveredconditionals="16" methods="4" coveredmethods="3" elements="84" coveredelements="81" complexity="0" loc="64" ncloc="64" packages="1" files="1" classes="1"/>
|
|
5
|
+
<file name="adapter.ts" path="/Users/maciejpyrc/Praca/better-typed/open-source/hyper-fetch/packages/adapter-axios/src/adapter/adapter.ts">
|
|
6
|
+
<metrics statements="64" coveredstatements="62" conditionals="16" coveredconditionals="16" methods="4" coveredmethods="3"/>
|
|
7
|
+
<line num="1" count="1" type="stmt"/>
|
|
8
|
+
<line num="2" count="1" type="stmt"/>
|
|
9
|
+
<line num="3" count="1" type="stmt"/>
|
|
10
|
+
<line num="4" count="1" type="stmt"/>
|
|
11
|
+
<line num="5" count="1" type="stmt"/>
|
|
12
|
+
<line num="6" count="1" type="cond" truecount="3" falsecount="0"/>
|
|
13
|
+
<line num="7" count="4" type="stmt"/>
|
|
14
|
+
<line num="8" count="4" type="stmt"/>
|
|
15
|
+
<line num="9" count="4" type="stmt"/>
|
|
16
|
+
<line num="10" count="4" type="stmt"/>
|
|
17
|
+
<line num="11" count="4" type="stmt"/>
|
|
18
|
+
<line num="12" count="4" type="stmt"/>
|
|
19
|
+
<line num="13" count="4" type="stmt"/>
|
|
20
|
+
<line num="14" count="4" type="stmt"/>
|
|
21
|
+
<line num="15" count="4" type="stmt"/>
|
|
22
|
+
<line num="16" count="4" type="stmt"/>
|
|
23
|
+
<line num="17" count="4" type="stmt"/>
|
|
24
|
+
<line num="18" count="4" type="stmt"/>
|
|
25
|
+
<line num="19" count="4" type="stmt"/>
|
|
26
|
+
<line num="20" count="4" type="stmt"/>
|
|
27
|
+
<line num="21" count="4" type="stmt"/>
|
|
28
|
+
<line num="22" count="4" type="stmt"/>
|
|
29
|
+
<line num="23" count="4" type="stmt"/>
|
|
30
|
+
<line num="24" count="4" type="stmt"/>
|
|
31
|
+
<line num="25" count="4" type="stmt"/>
|
|
32
|
+
<line num="26" count="4" type="stmt"/>
|
|
33
|
+
<line num="27" count="4" type="stmt"/>
|
|
34
|
+
<line num="28" count="4" type="stmt"/>
|
|
35
|
+
<line num="29" count="4" type="stmt"/>
|
|
36
|
+
<line num="30" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
37
|
+
<line num="31" count="4" type="stmt"/>
|
|
38
|
+
<line num="32" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
39
|
+
<line num="33" count="4" type="stmt"/>
|
|
40
|
+
<line num="34" count="4" type="stmt"/>
|
|
41
|
+
<line num="35" count="4" type="stmt"/>
|
|
42
|
+
<line num="36" count="4" type="stmt"/>
|
|
43
|
+
<line num="37" count="4" type="stmt"/>
|
|
44
|
+
<line num="38" count="4" type="stmt"/>
|
|
45
|
+
<line num="39" count="4" type="stmt"/>
|
|
46
|
+
<line num="40" count="4" type="stmt"/>
|
|
47
|
+
<line num="41" count="4" type="stmt"/>
|
|
48
|
+
<line num="42" count="4" type="stmt"/>
|
|
49
|
+
<line num="43" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
50
|
+
<line num="44" count="0" type="stmt"/>
|
|
51
|
+
<line num="45" count="0" type="stmt"/>
|
|
52
|
+
<line num="46" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
53
|
+
<line num="47" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
54
|
+
<line num="48" count="3" type="stmt"/>
|
|
55
|
+
<line num="49" count="3" type="stmt"/>
|
|
56
|
+
<line num="50" count="3" type="stmt"/>
|
|
57
|
+
<line num="51" count="4" type="stmt"/>
|
|
58
|
+
<line num="52" count="4" type="stmt"/>
|
|
59
|
+
<line num="53" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
60
|
+
<line num="54" count="2" type="stmt"/>
|
|
61
|
+
<line num="55" count="2" type="stmt"/>
|
|
62
|
+
<line num="56" count="4" type="stmt"/>
|
|
63
|
+
<line num="57" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
64
|
+
<line num="58" count="2" type="cond" truecount="5" falsecount="0"/>
|
|
65
|
+
<line num="59" count="4" type="stmt"/>
|
|
66
|
+
<line num="60" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
67
|
+
<line num="61" count="4" type="stmt"/>
|
|
68
|
+
<line num="62" count="4" type="stmt"/>
|
|
69
|
+
<line num="63" count="4" type="stmt"/>
|
|
70
|
+
<line num="64" count="4" type="stmt"/>
|
|
71
|
+
</file>
|
|
72
|
+
</project>
|
|
73
|
+
</coverage>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
{"/Users/maciejpyrc/Praca/better-typed/open-source/hyper-fetch/packages/adapter-axios/src/adapter/adapter.ts": {"path":"/Users/maciejpyrc/Praca/better-typed/open-source/hyper-fetch/packages/adapter-axios/src/adapter/adapter.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":68}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":0}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":51}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":0}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":83}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":9}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":16}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":11}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":12}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":12}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":12}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":12}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":18}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":17}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":24}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":23}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":22}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":20}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":20}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":19}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":14}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":23}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":89}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":0}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":29}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":0}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":20}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":0}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":35}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":44}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":93}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":0}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":21}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":11}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":16}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":20}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":13}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":19}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":32}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":67}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":31}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":30}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":45}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":11}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":20}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":46}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":23}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":26}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":42}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":8}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":6}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":27}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":90}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":24}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":8}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":25}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":99}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":8}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":22}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":26}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":9}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":5}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":2}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":4,"7":4,"8":4,"9":4,"10":4,"11":4,"12":4,"13":4,"14":4,"15":4,"16":4,"17":4,"18":4,"19":4,"20":4,"21":4,"22":4,"23":4,"24":4,"25":4,"26":4,"27":4,"28":4,"29":4,"30":4,"31":4,"32":4,"33":4,"34":4,"35":4,"36":4,"37":4,"38":4,"39":4,"40":4,"41":4,"42":4,"43":0,"44":0,"45":4,"46":4,"47":3,"48":3,"49":3,"50":4,"51":4,"52":4,"53":2,"54":2,"55":4,"56":4,"57":2,"58":4,"59":4,"60":4,"61":4,"62":4,"63":4},"branchMap":{"0":{"type":"branch","line":6,"loc":{"start":{"line":6,"column":28},"end":{"line":64,"column":2}},"locations":[{"start":{"line":6,"column":28},"end":{"line":64,"column":2}}]},"1":{"type":"branch","line":6,"loc":{"start":{"line":6,"column":52},"end":{"line":64,"column":2}},"locations":[{"start":{"line":6,"column":52},"end":{"line":64,"column":2}}]},"2":{"type":"branch","line":6,"loc":{"start":{"line":6,"column":81},"end":{"line":64,"column":2}},"locations":[{"start":{"line":6,"column":81},"end":{"line":64,"column":2}}]},"3":{"type":"branch","line":30,"loc":{"start":{"line":30,"column":21},"end":{"line":63,"column":3}},"locations":[{"start":{"line":30,"column":21},"end":{"line":63,"column":3}}]},"4":{"type":"branch","line":43,"loc":{"start":{"line":43,"column":8},"end":{"line":45,"column":11}},"locations":[{"start":{"line":43,"column":8},"end":{"line":45,"column":11}}]},"5":{"type":"branch","line":46,"loc":{"start":{"line":46,"column":8},"end":{"line":46,"column":19}},"locations":[{"start":{"line":46,"column":8},"end":{"line":46,"column":19}}]},"6":{"type":"branch","line":32,"loc":{"start":{"line":32,"column":28},"end":{"line":32,"column":92}},"locations":[{"start":{"line":32,"column":28},"end":{"line":32,"column":92}}]},"7":{"type":"branch","line":47,"loc":{"start":{"line":47,"column":26},"end":{"line":51,"column":7}},"locations":[{"start":{"line":47,"column":26},"end":{"line":51,"column":7}}]},"8":{"type":"branch","line":53,"loc":{"start":{"line":53,"column":12},"end":{"line":56,"column":7}},"locations":[{"start":{"line":53,"column":12},"end":{"line":56,"column":7}}]},"9":{"type":"branch","line":57,"loc":{"start":{"line":57,"column":13},"end":{"line":59,"column":7}},"locations":[{"start":{"line":57,"column":13},"end":{"line":59,"column":7}}]},"10":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":37},"end":{"line":58,"column":39}},"locations":[{"start":{"line":58,"column":37},"end":{"line":58,"column":39}}]},"11":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":37},"end":{"line":58,"column":45}},"locations":[{"start":{"line":58,"column":37},"end":{"line":58,"column":45}}]},"12":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":45},"end":{"line":58,"column":50}},"locations":[{"start":{"line":58,"column":45},"end":{"line":58,"column":50}}]},"13":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":77},"end":{"line":58,"column":79}},"locations":[{"start":{"line":58,"column":77},"end":{"line":58,"column":79}}]},"14":{"type":"branch","line":58,"loc":{"start":{"line":58,"column":77},"end":{"line":58,"column":86}},"locations":[{"start":{"line":58,"column":77},"end":{"line":58,"column":86}}]},"15":{"type":"branch","line":60,"loc":{"start":{"line":60,"column":15},"end":{"line":62,"column":7}},"locations":[{"start":{"line":60,"column":15},"end":{"line":62,"column":7}}]}},"b":{"0":[5],"1":[4],"2":[4],"3":[4],"4":[1],"5":[3],"6":[4],"7":[3],"8":[2],"9":[2],"10":[1],"11":[1],"12":[1],"13":[1],"14":[1],"15":[4]},"fnMap":{"0":{"name":"axiosAdapter","decl":{"start":{"line":6,"column":28},"end":{"line":64,"column":2}},"loc":{"start":{"line":6,"column":28},"end":{"line":64,"column":2}},"line":6},"1":{"name":"unmountListener","decl":{"start":{"line":32,"column":28},"end":{"line":32,"column":92}},"loc":{"start":{"line":32,"column":28},"end":{"line":32,"column":92}},"line":32},"2":{"name":"Object.assign.onUploadProgress","decl":{"start":{"line":43,"column":10},"end":{"line":45,"column":11}},"loc":{"start":{"line":43,"column":10},"end":{"line":45,"column":11}},"line":43},"3":{"name":"onDownloadProgress","decl":{"start":{"line":47,"column":26},"end":{"line":51,"column":7}},"loc":{"start":{"line":47,"column":26},"end":{"line":51,"column":7}},"line":47}},"f":{"0":5,"1":4,"2":0,"3":3}}
|
|
2
|
+
}
|