| Total Complexity | 8 |
| Complexity/F | 2 |
| Lines of Code | 26 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | "use strict"; |
||
| 2 | var __assign = (this && this.__assign) || function () { |
||
| 3 | __assign = Object.assign || function(t) { |
||
| 4 | for (var s, i = 1, n = arguments.length; i < n; i++) { |
||
| 5 | s = arguments[i]; |
||
| 6 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) |
||
| 7 | t[p] = s[p]; |
||
| 8 | } |
||
| 9 | return t; |
||
| 10 | }; |
||
| 11 | return __assign.apply(this, arguments); |
||
| 12 | }; |
||
| 13 | Object.defineProperty(exports, "__esModule", { value: true }); |
||
| 14 | var CompoundDocument_1 = require("./CompoundDocument"); |
||
| 15 | var RelationshipsCache_1 = require("./RelationshipsCache"); |
||
| 16 | var fromCompoundDocument = function (w) { |
||
| 17 | var _a = w(), data = _a[0], relationships = _a[1]; |
||
| 18 | var cache = RelationshipsCache_1.RelationshipsCache.fromRelationships(relationships); |
||
| 19 | var included = Object.values(RelationshipsCache_1.RelationshipsCache.lens.global.get(cache)); |
||
| 20 | return __assign({ data: data }, (included.length > 0 ? { included: included } : null)); |
||
| 21 | }; |
||
| 22 | var fromJson = function (u) { return fromCompoundDocument(CompoundDocument_1.CompoundDocument.fromJson(u, true)); }; |
||
| 23 | exports.Document = { |
||
| 24 | fromCompoundDocument: fromCompoundDocument, |
||
| 25 | fromJson: fromJson |
||
| 26 | }; |
||
| 27 |