@thi.ng/markdown-table 0.3.53 → 0.3.56
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.
- package/CHANGELOG.md +7 -1
- package/README.md +3 -2
- package/package.json +11 -11
- package/table.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-
|
|
3
|
+
- **Last updated**: 2023-08-10T12:25:09Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [0.3.54](https://github.com/thi-ng/umbrella/tree/@thi.ng/markdown-table@0.3.54) (2023-08-04)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- minor internal updates ([5165d05](https://github.com/thi-ng/umbrella/commit/5165d05))
|
|
17
|
+
|
|
12
18
|
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/markdown-table@0.3.0) (2021-11-17)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
|
+
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
|
|
2
3
|
|
|
3
|
-
# 
|
|
4
5
|
|
|
5
6
|
[](https://www.npmjs.com/package/@thi.ng/markdown-table)
|
|
6
7
|

|
|
@@ -55,7 +56,7 @@ For Node.js REPL:
|
|
|
55
56
|
const markdownTable = await import("@thi.ng/markdown-table");
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
Package sizes (brotli'd, pre-treeshake): ESM:
|
|
59
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 622 bytes
|
|
59
60
|
|
|
60
61
|
## Dependencies
|
|
61
62
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/markdown-table",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.56",
|
|
4
4
|
"description": "Markdown table formatter/generator with support for column alignments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/checks": "^3.
|
|
39
|
-
"@thi.ng/compose": "^2.1.
|
|
40
|
-
"@thi.ng/errors": "^2.2
|
|
41
|
-
"@thi.ng/strings": "^3.4.
|
|
42
|
-
"@thi.ng/transducers": "^8.
|
|
37
|
+
"@thi.ng/api": "^8.9.2",
|
|
38
|
+
"@thi.ng/checks": "^3.4.2",
|
|
39
|
+
"@thi.ng/compose": "^2.1.37",
|
|
40
|
+
"@thi.ng/errors": "^2.3.2",
|
|
41
|
+
"@thi.ng/strings": "^3.4.10",
|
|
42
|
+
"@thi.ng/transducers": "^8.5.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.
|
|
46
|
-
"@thi.ng/testament": "^0.3.
|
|
45
|
+
"@microsoft/api-extractor": "^7.36.3",
|
|
46
|
+
"@thi.ng/testament": "^0.3.20",
|
|
47
47
|
"rimraf": "^5.0.1",
|
|
48
48
|
"tools": "^0.0.1",
|
|
49
49
|
"typedoc": "^0.24.8",
|
|
50
|
-
"typescript": "^5.1.
|
|
50
|
+
"typescript": "^5.1.6"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"align",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
],
|
|
88
88
|
"year": 2021
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "ad9ac3232c6fc5fc8a0df75ac82fc1e0e9fb0258\n"
|
|
91
91
|
}
|
package/table.js
CHANGED
|
@@ -11,6 +11,7 @@ import { last } from "@thi.ng/transducers/last";
|
|
|
11
11
|
import { map } from "@thi.ng/transducers/map";
|
|
12
12
|
import { max } from "@thi.ng/transducers/max";
|
|
13
13
|
import { multiplex } from "@thi.ng/transducers/multiplex";
|
|
14
|
+
import { range } from "@thi.ng/transducers/range";
|
|
14
15
|
import { repeat as $repeat } from "@thi.ng/transducers/repeat";
|
|
15
16
|
import { repeatedly } from "@thi.ng/transducers/repeatedly";
|
|
16
17
|
import { scan } from "@thi.ng/transducers/scan";
|
|
@@ -68,7 +69,7 @@ export const table = (header, rows, opts = {}) => {
|
|
|
68
69
|
...repeatedly((i) => comp(map((row) => row[i] != null ? String(row[i]).length : 0), scan(max())), numColumns),
|
|
69
70
|
]), last(), body);
|
|
70
71
|
const pads = widths.map((w, i) => PADS[align[i]](w));
|
|
71
|
-
const colIDs = [...
|
|
72
|
+
const colIDs = [...range(numColumns)];
|
|
72
73
|
const result = body.map((row) => colIDs.map((i) => `| ${pads[i](str(row[i]))} `).join("") + "|");
|
|
73
74
|
result.splice(1, 0, widths.map((w, i) => `|${SEPS[align[i]](w)}`).join("") + "|");
|
|
74
75
|
return result.join("\n");
|