Passed
Push — master ( 746cb5...4ed6ec )
by Alberto
47s queued 11s
created

lib/RelationshipsRecord.js   A

Complexity

Total Complexity 7
Complexity/F 1.75

Size

Lines of Code 22
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 17
mnd 3
bc 3
fnc 4
dl 0
loc 22
bpm 0.75
cpm 1.75
noi 4
c 0
b 0
f 0
rs 10
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
exports.RelationshipsRecord = {
15
    nest: function (relationships, key) {
16
        return Object.keys(relationships)
17
            .reduce(function (record, k) {
18
            var _a;
19
            return (__assign(__assign({}, record), (_a = {}, _a[key + "." + k] = relationships[k], _a)));
20
        }, {});
21
    }
22
};
23