@envelop/parser-cache 4.4.0-alpha-35741fe.0 → 4.4.0-alpha-aca44e1.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.
Files changed (3) hide show
  1. package/index.js +3 -3
  2. package/index.mjs +3 -3
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const core = require('@envelop/core');
6
6
 
7
7
  const useParserCache = (pluginOptions = {}) => {
8
- const documentCache = typeof pluginOptions.documentCache !== 'undefined' ? pluginOptions.documentCache : core.getInMemoryLRUCache();
9
- const errorCache = typeof pluginOptions.errorCache !== 'undefined' ? pluginOptions.errorCache : core.getInMemoryLRUCache();
8
+ const documentCache = pluginOptions.documentCache != null ? pluginOptions.documentCache : core.getInMemoryLRUCache();
9
+ const errorCache = pluginOptions.errorCache != null ? pluginOptions.errorCache : core.getInMemoryLRUCache();
10
10
  return {
11
11
  onParse({ params, setParsedDocument }) {
12
12
  var _a;
@@ -25,7 +25,7 @@ const useParserCache = (pluginOptions = {}) => {
25
25
  if (result instanceof Error) {
26
26
  errorCache.set(key, result);
27
27
  }
28
- else if (result !== null) {
28
+ else if (result != null) {
29
29
  documentCache.set(key, result);
30
30
  }
31
31
  };
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { getInMemoryLRUCache, isSourceObject } from '@envelop/core';
2
2
 
3
3
  const useParserCache = (pluginOptions = {}) => {
4
- const documentCache = typeof pluginOptions.documentCache !== 'undefined' ? pluginOptions.documentCache : getInMemoryLRUCache();
5
- const errorCache = typeof pluginOptions.errorCache !== 'undefined' ? pluginOptions.errorCache : getInMemoryLRUCache();
4
+ const documentCache = pluginOptions.documentCache != null ? pluginOptions.documentCache : getInMemoryLRUCache();
5
+ const errorCache = pluginOptions.errorCache != null ? pluginOptions.errorCache : getInMemoryLRUCache();
6
6
  return {
7
7
  onParse({ params, setParsedDocument }) {
8
8
  var _a;
@@ -21,7 +21,7 @@ const useParserCache = (pluginOptions = {}) => {
21
21
  if (result instanceof Error) {
22
22
  errorCache.set(key, result);
23
23
  }
24
- else if (result !== null) {
24
+ else if (result != null) {
25
25
  documentCache.set(key, result);
26
26
  }
27
27
  };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/parser-cache",
3
- "version": "4.4.0-alpha-35741fe.0",
3
+ "version": "4.4.0-alpha-aca44e1.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.4.0-alpha-35741fe.0",
6
+ "@envelop/core": "2.4.0-alpha-aca44e1.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "repository": {