Skip to content

Commit

Permalink
Builds 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weilandia committed May 15, 2020
1 parent 797a461 commit 802f3fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ var deserialize = function deserialize(resp) {
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapRelationships", function() { return mapRelationships; });
/* harmony import */ var _flattenAttributes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

Expand All @@ -186,7 +190,7 @@ var findResource = function findResource(rel, included) {

var deserializeIncluded = function deserializeIncluded(rel, included) {
var resource = findResource(rel, included);
if (!resource) return [];
if (!resource) return [undefined, included];
var filteredIncluded = included.map(function (res) {
if (res !== resource) return res;

Expand All @@ -195,7 +199,7 @@ var deserializeIncluded = function deserializeIncluded(rel, included) {

return filter;
});
return [_objectSpread({}, rel, {}, Object(_flattenAttributes__WEBPACK_IMPORTED_MODULE_0__["flattenAttributes"])(resource)), filteredIncluded];
return [_objectSpread(_objectSpread({}, rel), Object(_flattenAttributes__WEBPACK_IMPORTED_MODULE_0__["flattenAttributes"])(resource)), filteredIncluded];
};

var mapRelationships = function mapRelationships(resource, included) {
Expand Down Expand Up @@ -270,7 +274,7 @@ var asAttributes = function asAttributes(_ref) {
rest = _objectWithoutProperties(_ref, ["attributes"]);

if (!attributes || attributes.constructor !== Object) return rest;
return _objectSpread({}, rest, {}, attributes);
return _objectSpread(_objectSpread({}, rest), attributes);
};

var flattenAttributes = function flattenAttributes(data) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deserialize-json-api",
"version": "1.3.1",
"version": "1.3.2",
"description": "Immutable json:api deserializer",
"main": "lib/index.js",
"repository": "https://github.com/weilandia/deserialize-json-api",
Expand Down

0 comments on commit 802f3fc

Please sign in to comment.