table 5.2.2 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,7 +17,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
*/
|
|
18
18
|
const calculateCellWidthIndex = cells => {
|
|
19
19
|
return cells.map(value => {
|
|
20
|
-
return (
|
|
20
|
+
return Math.max(...value.split('\n').map(line => {
|
|
21
|
+
return (0, _stringWidth.default)(line);
|
|
22
|
+
}));
|
|
21
23
|
});
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/calculateCellWidthIndex.js"],"names":["cells","map","value"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;gCAMgBA,K,IAAU;AACxB,SAAOA,KAAK,CAACC,GAAN,CAAWC,KAAD,IAAW;AAC1B,
|
|
1
|
+
{"version":3,"sources":["../src/calculateCellWidthIndex.js"],"names":["cells","map","value","Math","max","split","line"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;gCAMgBA,K,IAAU;AACxB,SAAOA,KAAK,CAACC,GAAN,CAAWC,KAAD,IAAW;AAC1B,WAAOC,IAAI,CAACC,GAAL,CACL,GAAGF,KAAK,CAACG,KAAN,CAAY,IAAZ,EAAkBJ,GAAlB,CAAuBK,IAAD,IAAU;AACjC,aAAO,0BAAYA,IAAZ,CAAP;AACD,KAFE,CADE,CAAP;AAKD,GANM,CAAP;AAOD,C","sourcesContent":["import stringWidth from 'string-width';\n\n/**\n * Calculates width of each cell contents.\n *\n * @param {string[]} cells\n * @returns {number[]}\n */\nexport default (cells) => {\n return cells.map((value) => {\n return Math.max(\n ...value.split('\\n').map((line) => {\n return stringWidth(line);\n })\n );\n });\n};\n"],"file":"calculateCellWidthIndex.js"}
|
package/package.json
CHANGED
|
@@ -5,36 +5,36 @@
|
|
|
5
5
|
"url": "http://gajus.com"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"ajv": "^6.
|
|
8
|
+
"ajv": "^6.9.1",
|
|
9
9
|
"lodash": "^4.17.11",
|
|
10
|
-
"slice-ansi": "^2.
|
|
11
|
-
"string-width": "^
|
|
10
|
+
"slice-ansi": "^2.1.0",
|
|
11
|
+
"string-width": "^3.0.0"
|
|
12
12
|
},
|
|
13
13
|
"description": "Formats data into a string table.",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@babel/cli": "^7.
|
|
16
|
-
"@babel/core": "^7.
|
|
17
|
-
"@babel/node": "^7.
|
|
18
|
-
"@babel/plugin-transform-flow-strip-types": "^7.
|
|
19
|
-
"@babel/preset-env": "^7.1
|
|
15
|
+
"@babel/cli": "^7.2.3",
|
|
16
|
+
"@babel/core": "^7.2.2",
|
|
17
|
+
"@babel/node": "^7.2.2",
|
|
18
|
+
"@babel/plugin-transform-flow-strip-types": "^7.2.3",
|
|
19
|
+
"@babel/preset-env": "^7.3.1",
|
|
20
20
|
"@babel/register": "^7.0.0",
|
|
21
21
|
"ajv-cli": "^3.0.0",
|
|
22
|
-
"ajv-keywords": "^3.
|
|
22
|
+
"ajv-keywords": "^3.4.0",
|
|
23
23
|
"babel-plugin-istanbul": "^5.1.0",
|
|
24
24
|
"babel-plugin-transform-export-default-name": "^2.0.4",
|
|
25
25
|
"chai": "^4.2.0",
|
|
26
|
-
"chalk": "^2.4.
|
|
26
|
+
"chalk": "^2.4.2",
|
|
27
27
|
"coveralls": "^3.0.2",
|
|
28
|
-
"eslint": "^5.
|
|
29
|
-
"eslint-config-canonical": "^
|
|
30
|
-
"flow-bin": "^0.
|
|
28
|
+
"eslint": "^5.13.0",
|
|
29
|
+
"eslint-config-canonical": "^16.1.0",
|
|
30
|
+
"flow-bin": "^0.92.1",
|
|
31
31
|
"flow-copy-source": "^2.0.2",
|
|
32
|
-
"gitdown": "^2.5.
|
|
33
|
-
"husky": "^1.
|
|
32
|
+
"gitdown": "^2.5.7",
|
|
33
|
+
"husky": "^1.3.1",
|
|
34
34
|
"mocha": "^5.2.0",
|
|
35
|
-
"nyc": "^13.
|
|
36
|
-
"semantic-release": "^15.
|
|
37
|
-
"sinon": "^7.
|
|
35
|
+
"nyc": "^13.2.0",
|
|
36
|
+
"semantic-release": "^15.13.3",
|
|
37
|
+
"sinon": "^7.2.3"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=6.0.0"
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"lint": "npm run build && eslint ./src ./test && flow",
|
|
80
80
|
"test": "mocha --require @babel/register"
|
|
81
81
|
},
|
|
82
|
-
"version": "5.2.
|
|
82
|
+
"version": "5.2.3"
|
|
83
83
|
}
|