cacheable-request 10.2.3 → 10.2.5
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/README.md +1 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/package.json +17 -9
package/README.md
CHANGED
|
@@ -50,7 +50,6 @@ const cacheableRequest = new CacheableRequest(electron.net);
|
|
|
50
50
|
### Usage After v10.1.0
|
|
51
51
|
```js
|
|
52
52
|
|
|
53
|
-
```js
|
|
54
53
|
import CacheableRequest from 'cacheable-request';
|
|
55
54
|
|
|
56
55
|
// Now You can do
|
|
@@ -264,7 +263,7 @@ cacheableRequest('example.com', cb)
|
|
|
264
263
|
|
|
265
264
|
|
|
266
265
|
## Using Hooks
|
|
267
|
-
Hooks have been implemented since version `v9` and are very useful to modify response before saving it in cache. You can use hooks to modify response before saving it in cache.
|
|
266
|
+
Hooks have been implemented since version `v9` and are very useful to modify response before saving it in cache. You can use hooks to modify response before saving it in cache.
|
|
268
267
|
|
|
269
268
|
### Add Hooks
|
|
270
269
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ declare class CacheableRequest {
|
|
|
5
5
|
cacheRequest: RequestFn;
|
|
6
6
|
hooks: Map<string, Func>;
|
|
7
7
|
constructor(cacheRequest: RequestFn, cacheAdapter?: StorageAdapter | string);
|
|
8
|
-
request: () => (options: CacheableOptions, cb?: (
|
|
8
|
+
request: () => (options: CacheableOptions, cb?: (response: CacheResponse) => void) => Emitter;
|
|
9
9
|
addHook: (name: string, fn: Func) => void;
|
|
10
10
|
removeHook: (name: string) => boolean;
|
|
11
|
-
getHook: (name: string) => Func
|
|
11
|
+
getHook: (name: string) => Func;
|
|
12
12
|
runHook: (name: string, ...args: any[]) => Promise<CacheValue>;
|
|
13
13
|
}
|
|
14
14
|
export default CacheableRequest;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts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gBAAgB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,eAAO,MAAM,UAAU,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cacheable-request",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.5",
|
|
4
4
|
"description": "Wrap native HTTP requests with RFC compliant cache support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "jaredwray/cacheable-request",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"7234",
|
|
33
33
|
"compliant"
|
|
34
34
|
],
|
|
35
|
+
"dependenciesComments": {
|
|
36
|
+
"@types/http-cache-semantics": "It needs to be in the dependencies list and not devDependencies because otherwise projects that use this one will be getting `Could not find a declaration file for module 'http-cache-semantics'` error when running `tsc`, see https://github.com/jaredwray/cacheable-request/issues/194 for details"
|
|
37
|
+
},
|
|
35
38
|
"dependencies": {
|
|
36
39
|
"@types/http-cache-semantics": "^4.0.1",
|
|
37
40
|
"get-stream": "^6.0.1",
|
|
@@ -42,26 +45,30 @@
|
|
|
42
45
|
"responselike": "^3.0.0"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@keyv/sqlite": "^3.6.
|
|
46
|
-
"@types/create-test-server": "^3.0.1",
|
|
48
|
+
"@keyv/sqlite": "^3.6.4",
|
|
47
49
|
"@types/delay": "^3.1.0",
|
|
48
50
|
"@types/get-stream": "^3.0.2",
|
|
49
|
-
"@types/jest": "^29.2.
|
|
50
|
-
"@types/node": "^18.11.
|
|
51
|
+
"@types/jest": "^29.2.4",
|
|
52
|
+
"@types/node": "^18.11.17",
|
|
51
53
|
"@types/responselike": "^1.0.0",
|
|
52
54
|
"@types/sqlite3": "^3.1.8",
|
|
53
|
-
"
|
|
55
|
+
"body-parser": "^1.20.1",
|
|
54
56
|
"delay": "^5.0.0",
|
|
55
|
-
"eslint-plugin-jest": "^27.1.
|
|
57
|
+
"eslint-plugin-jest": "^27.1.7",
|
|
58
|
+
"express": "^4.18.2",
|
|
56
59
|
"jest": "^29.3.1",
|
|
57
|
-
"
|
|
60
|
+
"pify": "^6.1.0",
|
|
61
|
+
"sqlite3": "^5.1.4",
|
|
58
62
|
"ts-jest": "^29.0.3",
|
|
59
63
|
"ts-jest-resolver": "^2.0.0",
|
|
60
64
|
"ts-node": "^10.9.1",
|
|
61
|
-
"typescript": "^4.9.
|
|
65
|
+
"typescript": "^4.9.4",
|
|
62
66
|
"xo": "^0.53.1"
|
|
63
67
|
},
|
|
64
68
|
"jest": {
|
|
69
|
+
"collectCoverageFrom": [
|
|
70
|
+
"src/**/*.{ts,js}"
|
|
71
|
+
],
|
|
65
72
|
"extensionsToTreatAsEsm": [
|
|
66
73
|
".ts"
|
|
67
74
|
],
|
|
@@ -100,6 +107,7 @@
|
|
|
100
107
|
"@typescript-eslint/restrict-template-expressions": 0,
|
|
101
108
|
"@typescript-eslint/no-unsafe-return": 0,
|
|
102
109
|
"new-cap": 0,
|
|
110
|
+
"unicorn/no-abusive-eslint-disable": 0,
|
|
103
111
|
"@typescript-eslint/restrict-plus-operands": 0,
|
|
104
112
|
"@typescript-eslint/no-implicit-any-catch": 0,
|
|
105
113
|
"@typescript-eslint/consistent-type-imports": 0,
|