projects
/
dotfiles
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
minimal adjustments
[dotfiles/.git]
/
.config
/
coc
/
extensions
/
node_modules
/
coc-prettier
/
node_modules
/
table
/
dist
/
calculateCellWidthIndex.js.flow
1
import stringWidth from 'string-width';
2
3
/**
4
* Calculates width of each cell contents.
5
*
6
* @param {string[]} cells
7
* @returns {number[]}
8
*/
9
export default (cells) => {
10
return cells.map((value) => {
11
return Math.max(
12
...value.split('\n').map((line) => {
13
return stringWidth(line);
14
}),
15
);
16
});
17
};