@aomex/response-time 0.0.20 → 0.0.21
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/CHANGELOG.md +4 -116
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,121 +1,9 @@
|
|
|
1
1
|
# @aomex/response-time
|
|
2
2
|
|
|
3
|
-
## 0.0.
|
|
3
|
+
## 0.0.21
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [[`
|
|
8
|
-
- @aomex/
|
|
9
|
-
- @aomex/
|
|
10
|
-
|
|
11
|
-
## 0.0.19
|
|
12
|
-
|
|
13
|
-
### Patch Changes
|
|
14
|
-
|
|
15
|
-
- Updated dependencies [[`a8dbaf3`](https://github.com/aomex/aomex/commit/a8dbaf38524f5a5d58337bc617175115742f9e1a), [`ddcec91`](https://github.com/aomex/aomex/commit/ddcec91803b00f35f7c55964d1a2d97c40a22c6e)]:
|
|
16
|
-
- @aomex/web@0.0.21
|
|
17
|
-
- @aomex/core@0.0.20
|
|
18
|
-
|
|
19
|
-
## 0.0.18
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- Updated dependencies []:
|
|
24
|
-
- @aomex/core@0.0.19
|
|
25
|
-
- @aomex/web@0.0.20
|
|
26
|
-
|
|
27
|
-
## 0.0.17
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- Updated dependencies []:
|
|
32
|
-
- @aomex/core@0.0.18
|
|
33
|
-
- @aomex/web@0.0.19
|
|
34
|
-
|
|
35
|
-
## 0.0.16
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- Updated dependencies []:
|
|
40
|
-
- @aomex/core@0.0.17
|
|
41
|
-
- @aomex/web@0.0.18
|
|
42
|
-
|
|
43
|
-
## 0.0.15
|
|
44
|
-
|
|
45
|
-
### Patch Changes
|
|
46
|
-
|
|
47
|
-
- Updated dependencies [[`216aa79`](https://github.com/aomex/aomex/commit/216aa798bcd2d0856f5fe4028235aa54d4b10922)]:
|
|
48
|
-
- @aomex/web@0.0.17
|
|
49
|
-
- @aomex/core@0.0.16
|
|
50
|
-
|
|
51
|
-
## 0.0.14
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
- Updated dependencies [[`280359e`](https://github.com/aomex/aomex/commit/280359eb90b71720304cfc212374b6dc4c90236d), [`9881653`](https://github.com/aomex/aomex/commit/988165361439738d27bc29bd0ed5a85c608db5ef), [`15ecd1c`](https://github.com/aomex/aomex/commit/15ecd1c75bc21929f79980b32e63ea46e081cc6a)]:
|
|
56
|
-
- @aomex/web@0.0.16
|
|
57
|
-
- @aomex/core@0.0.15
|
|
58
|
-
|
|
59
|
-
## 0.0.13
|
|
60
|
-
|
|
61
|
-
### Patch Changes
|
|
62
|
-
|
|
63
|
-
- Updated dependencies []:
|
|
64
|
-
- @aomex/core@0.0.14
|
|
65
|
-
- @aomex/web@0.0.15
|
|
66
|
-
|
|
67
|
-
## 0.0.12
|
|
68
|
-
|
|
69
|
-
### Patch Changes
|
|
70
|
-
|
|
71
|
-
- Updated dependencies [[`715cf66`](https://github.com/aomex/aomex/commit/715cf660e3b275b338dcf15c25ba9523cf6fb204)]:
|
|
72
|
-
- @aomex/web@0.0.14
|
|
73
|
-
- @aomex/core@0.0.13
|
|
74
|
-
|
|
75
|
-
## 0.0.11
|
|
76
|
-
|
|
77
|
-
### Patch Changes
|
|
78
|
-
|
|
79
|
-
- Updated dependencies [[`6e63df8`](https://github.com/aomex/aomex/commit/6e63df84d1b32e713aba8c52451e289a72b57bae), [`67acf4f`](https://github.com/aomex/aomex/commit/67acf4f42cd86bf1f0a7c647a5ff779c7cd0fa10)]:
|
|
80
|
-
- @aomex/web@0.0.13
|
|
81
|
-
- @aomex/core@0.0.12
|
|
82
|
-
|
|
83
|
-
## 0.0.10
|
|
84
|
-
|
|
85
|
-
### Patch Changes
|
|
86
|
-
|
|
87
|
-
- Updated dependencies [[`f14eb5f`](https://github.com/aomex/aomex/commit/f14eb5fe7bf06e1e2f64d45e3546c96d6079a2f1), [`7d923cf`](https://github.com/aomex/aomex/commit/7d923cf971b6a23d50113ab104c67041c6489053), [`3c5ad4e`](https://github.com/aomex/aomex/commit/3c5ad4e2f34be7da54c8b63f6fd4b88fd1e593c4), [`6154ee5`](https://github.com/aomex/aomex/commit/6154ee5ed500984f969d4c335ac3ad800c739937), [`92273f9`](https://github.com/aomex/aomex/commit/92273f913e38543f34f41ec5941ff43b6e1caaa9), [`a0fd49e`](https://github.com/aomex/aomex/commit/a0fd49ef276c05f312257521c75887458857bbb7)]:
|
|
88
|
-
- @aomex/web@0.0.12
|
|
89
|
-
- @aomex/core@0.0.11
|
|
90
|
-
|
|
91
|
-
## 0.0.9
|
|
92
|
-
|
|
93
|
-
### Patch Changes
|
|
94
|
-
|
|
95
|
-
- Updated dependencies [[`d9dc050`](https://github.com/aomex/aomex/commit/d9dc050897367353588c4bb778cbafb7607406ab), [`41ae605`](https://github.com/aomex/aomex/commit/41ae6054b2e87c4120f3fcee12302bb3d96f1df3)]:
|
|
96
|
-
- @aomex/web@0.0.11
|
|
97
|
-
- @aomex/core@0.0.10
|
|
98
|
-
|
|
99
|
-
## 0.0.8
|
|
100
|
-
|
|
101
|
-
### Patch Changes
|
|
102
|
-
|
|
103
|
-
- Updated dependencies [[`2439286`](https://github.com/aomex/aomex/commit/2439286e69dcc7211ac280b91dbca5de95cc488b)]:
|
|
104
|
-
- @aomex/web@0.0.10
|
|
105
|
-
- @aomex/core@0.0.9
|
|
106
|
-
|
|
107
|
-
## 0.0.7
|
|
108
|
-
|
|
109
|
-
### Patch Changes
|
|
110
|
-
|
|
111
|
-
- Updated dependencies [[`dcf2f4b`](https://github.com/aomex/aomex/commit/dcf2f4b6a13228d4731e4969e6abff9bef8ef0e2), [`d788ce7`](https://github.com/aomex/aomex/commit/d788ce731af885eae3819683813b2a9502742cea), [`c6fe6cb`](https://github.com/aomex/aomex/commit/c6fe6cb2f21acf74bc06db1509deff4aa35c48b3), [`a2727fb`](https://github.com/aomex/aomex/commit/a2727fb7619341dc3b23736e5dc11cee7d65e0bc), [`4253004`](https://github.com/aomex/aomex/commit/42530043854956a42d16be090b89fbac70e2fa17), [`fc7008e`](https://github.com/aomex/aomex/commit/fc7008e889a55e6a0a268bb77cab5be0f0bd9d30), [`d80df1a`](https://github.com/aomex/aomex/commit/d80df1a07eb92214a9c3c7fa15c629ea1ee88c43)]:
|
|
112
|
-
- @aomex/web@0.0.9
|
|
113
|
-
- @aomex/core@0.0.8
|
|
114
|
-
|
|
115
|
-
## 0.0.5
|
|
116
|
-
|
|
117
|
-
### Patch Changes
|
|
118
|
-
|
|
119
|
-
- Updated dependencies [[`bbc8dda`](https://github.com/aomex/aomex/commit/bbc8dda9f0876c3402608133085350cc693def6f), [`ceb2d82`](https://github.com/aomex/aomex/commit/ceb2d8269755dca3f79b755224259b8a99bc65d0)]:
|
|
120
|
-
- @aomex/core@0.0.6
|
|
121
|
-
- @aomex/web@0.0.7
|
|
7
|
+
- Updated dependencies [[`6f7d706`](https://github.com/aomex/aomex/commit/6f7d7066c23711abdd149eb1c9a293ab8c4284a4), [`e21007a`](https://github.com/aomex/aomex/commit/e21007a82cb8eac73e1f696340bbe986d57dc159), [`e7bf93c`](https://github.com/aomex/aomex/commit/e7bf93cee6896c61d0bf3eb0921151dc6c1bc107), [`e21007a`](https://github.com/aomex/aomex/commit/e21007a82cb8eac73e1f696340bbe986d57dc159), [`818e840`](https://github.com/aomex/aomex/commit/818e840d36c7456a863fc071968b246c123c17f5), [`fb6c72d`](https://github.com/aomex/aomex/commit/fb6c72dbb266be4db92a542afe93dfa5d8c7cd41)]:
|
|
8
|
+
- @aomex/core@0.0.22
|
|
9
|
+
- @aomex/web@0.0.23
|
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { middleware } from '@aomex/core';\nimport type { WebMiddleware } from '@aomex/web';\n\nexport interface ResponseTimeOptions {\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { middleware } from '@aomex/core';\nimport type { WebMiddleware } from '@aomex/web';\n\nexport interface ResponseTimeOptions {\n /**\n * 包含毫秒。默认值:`true`\n */\n hrtime?: boolean;\n}\n\nexport const responseTime = (\n options: ResponseTimeOptions = {},\n): WebMiddleware => {\n const { hrtime = true } = options;\n\n return middleware.web(async (ctx, next) => {\n const start = process.hrtime();\n\n try {\n await next();\n } finally {\n const deltas = process.hrtime(start);\n let delta = deltas[0] * 1000 + deltas[1] / 1000000;\n\n if (!hrtime) {\n delta = Math.round(delta);\n }\n\n ctx.response.setHeader('X-Response-Time', delta + 'ms');\n }\n });\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;AAUpB,IAAM,eAAe,CAC1B,UAA+B,CAAC,MACd;AAClB,QAAM,EAAE,SAAS,KAAK,IAAI;AAE1B,SAAO,WAAW,IAAI,OAAO,KAAK,SAAS;AACzC,UAAM,QAAQ,QAAQ,OAAO;AAE7B,QAAI;AACF,YAAM,KAAK;AAAA,IACb,UAAE;AACA,YAAM,SAAS,QAAQ,OAAO,KAAK;AACnC,UAAI,QAAQ,OAAO,CAAC,IAAI,MAAO,OAAO,CAAC,IAAI;AAE3C,UAAI,CAAC,QAAQ;AACX,gBAAQ,KAAK,MAAM,KAAK;AAAA,MAC1B;AAEA,UAAI,SAAS,UAAU,mBAAmB,QAAQ,IAAI;AAAA,IACxD;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aomex/response-time",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "X-Response-Time header",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": "git@github.com:aomex/aomex.git",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@aomex/core": "^0.0.
|
|
31
|
-
"@aomex/web": "^0.0.
|
|
30
|
+
"@aomex/core": "^0.0.22",
|
|
31
|
+
"@aomex/web": "^0.0.23"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@aomex/core": "^0.0.
|
|
35
|
-
"@aomex/web": "^0.0.
|
|
34
|
+
"@aomex/core": "^0.0.22",
|
|
35
|
+
"@aomex/web": "^0.0.23"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"test": "vitest"
|