@envelop/parser-cache 5.0.0-alpha-4ba70ab.0 → 5.0.0-alpha-d0d0776.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/index.js +7 -5
- package/package.json +19 -7
package/index.js
CHANGED
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
const graphql = require('graphql');
|
|
8
|
-
const lru =
|
|
6
|
+
const lru = require('tiny-lru');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
const lru__default = /*#__PURE__*/_interopDefaultLegacy(lru);
|
|
9
11
|
|
|
10
12
|
const DEFAULT_MAX = 1000;
|
|
11
13
|
const DEFAULT_TTL = 3600000;
|
|
12
14
|
const useParserCache = (pluginOptions = {}) => {
|
|
13
15
|
const documentCache = typeof pluginOptions.documentCache !== 'undefined'
|
|
14
16
|
? pluginOptions.documentCache
|
|
15
|
-
:
|
|
16
|
-
const errorCache = typeof pluginOptions.errorCache !== 'undefined' ? pluginOptions.errorCache :
|
|
17
|
+
: lru__default["default"](DEFAULT_MAX, DEFAULT_TTL);
|
|
18
|
+
const errorCache = typeof pluginOptions.errorCache !== 'undefined' ? pluginOptions.errorCache : lru__default["default"](DEFAULT_MAX, DEFAULT_TTL);
|
|
17
19
|
return {
|
|
18
20
|
onParse({ params, setParsedDocument }) {
|
|
19
21
|
const { source } = params;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/parser-cache",
|
|
3
|
-
"version": "5.0.0-alpha-
|
|
3
|
+
"version": "5.0.0-alpha-d0d0776.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "3.0.0-alpha-d0d0776.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/n1ru4l/envelop.git",
|
|
15
15
|
"directory": "packages/plugins/parser-cache"
|
|
16
16
|
},
|
|
17
17
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
|
@@ -24,12 +24,24 @@
|
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
|
-
"require":
|
|
28
|
-
|
|
27
|
+
"require": {
|
|
28
|
+
"default": "./index.js",
|
|
29
|
+
"types": "./index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"import": {
|
|
32
|
+
"default": "./index.mjs",
|
|
33
|
+
"types": "./index.d.ts"
|
|
34
|
+
}
|
|
29
35
|
},
|
|
30
36
|
"./*": {
|
|
31
|
-
"require":
|
|
32
|
-
|
|
37
|
+
"require": {
|
|
38
|
+
"default": "./*.js",
|
|
39
|
+
"types": "./*.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"import": {
|
|
42
|
+
"default": "./*.mjs",
|
|
43
|
+
"types": "./*.d.ts"
|
|
44
|
+
}
|
|
33
45
|
},
|
|
34
46
|
"./package.json": "./package.json"
|
|
35
47
|
}
|