| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gavin/workspace/happymandarin/node_modules/table/dist/ |
Upload File : |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var cov_9n6q52jtc = function () {
var path = '/Users/gajuskuizinas/Documents/dev/gajus/table/src/mapDataUsingRowHeightIndex.js',
hash = 'ef60a93a63cc52a2b2024b7c01e8fc35b8ef865f',
global = new Function('return this')(),
gcv = '__coverage__',
coverageData = {
path: '/Users/gajuskuizinas/Documents/dev/gajus/table/src/mapDataUsingRowHeightIndex.js',
statementMap: {
'0': {
start: {
line: 12,
column: 21
},
end: {
line: 12,
column: 43
}
},
'1': {
start: {
line: 14,
column: 21
},
end: {
line: 38,
column: 4
}
},
'2': {
start: {
line: 15,
column: 22
},
end: {
line: 17,
column: 6
}
},
'3': {
start: {
line: 16,
column: 6
},
end: {
line: 16,
column: 43
}
},
'4': {
start: {
line: 23,
column: 4
},
end: {
line: 35,
column: 7
}
},
'5': {
start: {
line: 26,
column: 6
},
end: {
line: 30,
column: 7
}
},
'6': {
start: {
line: 27,
column: 8
},
end: {
line: 27,
column: 69
}
},
'7': {
start: {
line: 29,
column: 8
},
end: {
line: 29,
column: 71
}
},
'8': {
start: {
line: 32,
column: 6
},
end: {
line: 34,
column: 9
}
},
'9': {
start: {
line: 33,
column: 8
},
end: {
line: 33,
column: 41
}
},
'10': {
start: {
line: 37,
column: 4
},
end: {
line: 37,
column: 21
}
},
'11': {
start: {
line: 40,
column: 2
},
end: {
line: 40,
column: 31
}
}
},
fnMap: {
'0': {
name: '(anonymous_0)',
decl: {
start: {
line: 11,
column: 15
},
end: {
line: 11,
column: 16
}
},
loc: {
start: {
line: 11,
column: 57
},
end: {
line: 41,
column: 1
}
}
},
'1': {
name: '(anonymous_1)',
decl: {
start: {
line: 14,
column: 41
},
end: {
line: 14,
column: 42
}
},
loc: {
start: {
line: 14,
column: 60
},
end: {
line: 38,
column: 3
}
}
},
'2': {
name: '(anonymous_2)',
decl: {
start: {
line: 15,
column: 54
},
end: {
line: 15,
column: 55
}
},
loc: {
start: {
line: 15,
column: 60
},
end: {
line: 17,
column: 5
}
}
},
'3': {
name: '(anonymous_3)',
decl: {
start: {
line: 23,
column: 21
},
end: {
line: 23,
column: 22
}
},
loc: {
start: {
line: 23,
column: 40
},
end: {
line: 35,
column: 5
}
}
},
'4': {
name: '(anonymous_4)',
decl: {
start: {
line: 32,
column: 30
},
end: {
line: 32,
column: 31
}
},
loc: {
start: {
line: 32,
column: 48
},
end: {
line: 34,
column: 7
}
}
}
},
branchMap: {
'0': {
loc: {
start: {
line: 26,
column: 6
},
end: {
line: 30,
column: 7
}
},
type: 'if',
locations: [{
start: {
line: 26,
column: 6
},
end: {
line: 30,
column: 7
}
}, {
start: {
line: 26,
column: 6
},
end: {
line: 30,
column: 7
}
}]
}
},
s: {
'0': 0,
'1': 0,
'2': 0,
'3': 0,
'4': 0,
'5': 0,
'6': 0,
'7': 0,
'8': 0,
'9': 0,
'10': 0,
'11': 0
},
f: {
'0': 0,
'1': 0,
'2': 0,
'3': 0,
'4': 0
},
b: {
'0': [0, 0]
}
},
coverage = global[gcv] || (global[gcv] = {});
if (coverage[path] && coverage[path].hash === hash) {
return coverage[path];
}
coverageData.hash = hash;
return coverage[path] = coverageData;
}();
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
var _wrapString = require('./wrapString');
var _wrapString2 = _interopRequireDefault(_wrapString);
var _wrapWord = require('./wrapWord');
var _wrapWord2 = _interopRequireDefault(_wrapWord);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @param {Array} unmappedRows
* @param {number[]} rowHeightIndex
* @param {Object} config
* @returns {Array}
*/
exports.default = (unmappedRows, rowHeightIndex, config) => {
++cov_9n6q52jtc.f[0];
const tableWidth = (++cov_9n6q52jtc.s[0], unmappedRows[0].length);
const mappedRows = (++cov_9n6q52jtc.s[1], _lodash2.default.map(unmappedRows, (cells, index0) => {
++cov_9n6q52jtc.f[1];
const rowHeight = (++cov_9n6q52jtc.s[2], _lodash2.default.times(rowHeightIndex[index0], () => {
++cov_9n6q52jtc.f[2];
++cov_9n6q52jtc.s[3];
return _lodash2.default.fill(Array(tableWidth), '');
}));
// rowHeight
// [{row index within rowSaw; index2}]
// [{cell index within a virtual row; index1}]
++cov_9n6q52jtc.s[4];
_lodash2.default.forEach(cells, (value, index1) => {
++cov_9n6q52jtc.f[3];
let chunkedValue;
++cov_9n6q52jtc.s[5];
if (config.columns[index1].wrapWord) {
++cov_9n6q52jtc.b[0][0];
++cov_9n6q52jtc.s[6];
chunkedValue = (0, _wrapWord2.default)(value, config.columns[index1].width);
} else {
++cov_9n6q52jtc.b[0][1];
++cov_9n6q52jtc.s[7];
chunkedValue = (0, _wrapString2.default)(value, config.columns[index1].width);
}
++cov_9n6q52jtc.s[8];
_lodash2.default.forEach(chunkedValue, (part, index2) => {
++cov_9n6q52jtc.f[4];
++cov_9n6q52jtc.s[9];
rowHeight[index2][index1] = part;
});
});
++cov_9n6q52jtc.s[10];
return rowHeight;
}));
++cov_9n6q52jtc.s[11];
return _lodash2.default.flatten(mappedRows);
};
module.exports = exports['default'];