diff --git a/dist/alchemy-json_api.js b/dist/alchemy-json_api.js index 3123e91..9d4500a 100644 --- a/dist/alchemy-json_api.js +++ b/dist/alchemy-json_api.js @@ -11,7 +11,7 @@ var structuredClone__default = /*#__PURE__*/_interopDefaultLegacy(structuredClon function deserialize(originalResponse) { var response = structuredClone__default["default"](originalResponse); - var included = response.included || []; + var included = response?.included || []; if (Array.isArray(response.data)) { return response.data.map(function (data) { diff --git a/src/deserialize.js b/src/deserialize.js index a1edacc..5548744 100644 --- a/src/deserialize.js +++ b/src/deserialize.js @@ -6,7 +6,7 @@ export function deserialize(originalResponse, options = {}) { options = {} } - const included = response.included || [] + const included = response?.included || [] if (Array.isArray(response.data)) { return response.data.map((data) => {