react-datocms 4.0.4 → 4.0.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.
@@ -147,7 +147,7 @@ export function StructuredText<
147
147
  );
148
148
  }
149
149
 
150
- if (!isStructuredText(data) || !data.links) {
150
+ if (!(isStructuredText(data) && data.links)) {
151
151
  throw new RenderError(
152
152
  `The document contains an 'itemLink' node, but the passed data prop is not a Structured Text GraphQL response, or data.links is not present!`,
153
153
  node,
@@ -176,7 +176,7 @@ export function StructuredText<
176
176
  );
177
177
  }
178
178
 
179
- if (!isStructuredText(data) || !data.links) {
179
+ if (!(isStructuredText(data) && data.links)) {
180
180
  throw new RenderError(
181
181
  `The document contains an 'itemLink' node, but the passed data prop is not a Structured Text GraphQL response, or data.links is not present!`,
182
182
  node,
@@ -214,7 +214,7 @@ export function StructuredText<
214
214
  );
215
215
  }
216
216
 
217
- if (!isStructuredText(data) || !data.blocks) {
217
+ if (!(isStructuredText(data) && data.blocks)) {
218
218
  throw new RenderError(
219
219
  `The document contains an 'block' node, but the passed data prop is not a Structured Text GraphQL response, or data.blocks is not present!`,
220
220
  node,
package/src/setupTests.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { configure } from 'enzyme'
1
+ import { configure } from 'enzyme';
2
2
  import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
3
3
 
4
4
  configure({
5
5
  adapter: new Adapter(),
6
- })
6
+ });
@@ -6,7 +6,9 @@ import {
6
6
  ConnectionStatus,
7
7
  Options,
8
8
  } from 'datocms-listen';
9
- import { useDeepCompareEffectNoCheck as useDeepCompareEffect } from 'use-deep-compare-effect';
9
+ import {
10
+ useDeepCompareEffectNoCheck as useDeepCompareEffect,
11
+ } from 'use-deep-compare-effect';
10
12
 
11
13
  export type SubscribeToQueryOptions<QueryResult, QueryVariables> = Omit<
12
14
  Options<QueryResult, QueryVariables>,