@envelop/response-cache 6.2.3 → 6.2.4-alpha-20241010124418-18265ff80ed4e0aad56c52c12ef06bb3cef3c044

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/cjs/plugin.js CHANGED
@@ -413,6 +413,9 @@ function removeMetadataFieldsFromResult(data, onEntity) {
413
413
  if (Array.isArray(data)) {
414
414
  return data.map(record => removeMetadataFieldsFromResult(record, onEntity));
415
415
  }
416
+ if (typeof data !== 'object' || data == null) {
417
+ return data;
418
+ }
416
419
  // clone the data to avoid mutation
417
420
  data = { ...data };
418
421
  const typename = data.__responseCacheTypeName ?? data.__typename;
package/esm/plugin.js CHANGED
@@ -404,6 +404,9 @@ function removeMetadataFieldsFromResult(data, onEntity) {
404
404
  if (Array.isArray(data)) {
405
405
  return data.map(record => removeMetadataFieldsFromResult(record, onEntity));
406
406
  }
407
+ if (typeof data !== 'object' || data == null) {
408
+ return data;
409
+ }
407
410
  // clone the data to avoid mutation
408
411
  data = { ...data };
409
412
  const typename = data.__responseCacheTypeName ?? data.__typename;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envelop/response-cache",
3
- "version": "6.2.3",
3
+ "version": "6.2.4-alpha-20241010124418-18265ff80ed4e0aad56c52c12ef06bb3cef3c044",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@envelop/core": "^5.0.2",