Passed
Pull Request — master (#3)
by Alberto
02:16 queued 28s
created

lib/ResourceRecord.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
var ResourceIdentifier_1 = require("./ResourceIdentifier");
15
exports.ResourceRecord = {
16
    fromResources: function (resources) {
17
        return resources.reduce(function (record, resource) {
18
            var _a;
19
            return (__assign(__assign({}, record), (_a = {}, _a[ResourceIdentifier_1.ResourceIdentifier.iso.string.get(resource)] = resource, _a)));
20
        }, {});
21
    }
22
};
23