all files / base/ export-util.js

96.77% Statements 30/31
90% Branches 9/10
83.33% Functions 5/6
96.77% Lines 30/31
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 511×   1× 1× 1×   1× 104× 104× 4919× 4870× 4870× 68066× 67859×           103×   1× 67859× 67859× 67859× 67859× 67859× 947149× 947149×           67859×   1× 2× 4× 8× 1×       1×   1×   1×    
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PivotExportUtil = (function () {
        function PivotExportUtil() {
        }
        PivotExportUtil.getClonedPivotValues = function (pivotValues) {
            var clonedSets = [];
            for (var i = 0; i < pivotValues.length; i++) {
                if (pivotValues[i]) {
                    clonedSets[i] = [];
                    for (var j = 0; j < pivotValues[i].length; j++) {
                        if (pivotValues[i][j]) {
                            clonedSets[i][j] =
                                this.getClonedPivotValueObj(pivotValues[i][j]);
                        }
                    }
                }
            }
            return clonedSets;
        };
        PivotExportUtil.getClonedPivotValueObj = function (data) {
            var keyPos = 0;
            var framedSet = {};
            Eif (!(data === null || data === undefined)) {
                var fields = Object.keys(data);
                while (keyPos < fields.length) {
                    framedSet[fields[keyPos]] = data[fields[keyPos]];
                    keyPos++;
                }
            }
            else {
                framedSet = data;
            }
            return framedSet;
        };
        PivotExportUtil.isContainCommonElements = function (collection1, collection2) {
            for (var i = 0, cnt = collection1.length; i < cnt; i++) {
                for (var j = 0, lnt = collection2.length; j < lnt; j++) {
                    if (collection2[j] === collection1[i]) {
                        return true;
                    }
                }
            }
            return false;
        };
        return PivotExportUtil;
    }());
    exports.PivotExportUtil = PivotExportUtil;
});