ts-japi
Advanced tools
Comparing version 1.4.0 to 1.5.0
# Changelog | ||
## 1.5.0 | ||
### Minor Changes | ||
- Fixes https://github.com/mu-io/ts-japi/issues/23 | ||
## 1.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -89,3 +89,3 @@ "use strict"; | ||
_loop_1 = function (i_1, len_1) { | ||
var relator, relatedData, newData, newRelators; | ||
var relator, relatedData, newRelators, newData; | ||
return __generator(this, function (_a) { | ||
@@ -98,11 +98,12 @@ switch (_a.label) { | ||
relatedData = _a.sent(); | ||
newRelators = relator.getRelatedRelators(); | ||
newData = []; | ||
newRelators = relator.getRelatedRelators(); | ||
return [4 /*yield*/, Promise.all(relatedData.flat().map(function (datum) { return __awaiter(_this, void 0, void 0, function () { | ||
return [4 /*yield*/, Promise.all(relatedData | ||
.flat() | ||
.filter(function (d) { return d !== null; }) | ||
.map(function (datum) { return __awaiter(_this, void 0, void 0, function () { | ||
var resource, key; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(datum !== null)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, relator.getRelatedResource(datum)]; | ||
case 0: return [4 /*yield*/, relator.getRelatedResource(datum)]; | ||
case 1: | ||
@@ -112,7 +113,7 @@ resource = _a.sent(); | ||
if (!keys.includes(key)) { | ||
keys.push(key); | ||
included.push(resource); | ||
keys.push(key); | ||
newData.push(datum); | ||
} | ||
_a.label = 2; | ||
case 2: return [2 /*return*/]; | ||
return [2 /*return*/]; | ||
} | ||
@@ -119,0 +120,0 @@ }); |
{ | ||
"name": "ts-japi", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
214987
157
2824