@thi.ng/markdown-table 0.3.52 → 0.3.54

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-06-14T07:58:51Z
3
+ - **Last updated**: 2023-08-04T10:58:19Z
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
@@ -55,7 +55,7 @@ For Node.js REPL:
55
55
  const markdownTable = await import("@thi.ng/markdown-table");
56
56
  ```
57
57
 
58
- Package sizes (brotli'd, pre-treeshake): ESM: 619 bytes
58
+ Package sizes (brotli'd, pre-treeshake): ESM: 622 bytes
59
59
 
60
60
  ## Dependencies
61
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/markdown-table",
3
- "version": "0.3.52",
3
+ "version": "0.3.54",
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.8.2",
38
- "@thi.ng/checks": "^3.3.14",
39
- "@thi.ng/compose": "^2.1.34",
40
- "@thi.ng/errors": "^2.2.17",
41
- "@thi.ng/strings": "^3.4.7",
42
- "@thi.ng/transducers": "^8.4.6"
37
+ "@thi.ng/api": "^8.9.0",
38
+ "@thi.ng/checks": "^3.4.0",
39
+ "@thi.ng/compose": "^2.1.35",
40
+ "@thi.ng/errors": "^2.3.0",
41
+ "@thi.ng/strings": "^3.4.8",
42
+ "@thi.ng/transducers": "^8.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.35.3",
46
- "@thi.ng/testament": "^0.3.17",
45
+ "@microsoft/api-extractor": "^7.36.3",
46
+ "@thi.ng/testament": "^0.3.18",
47
47
  "rimraf": "^5.0.1",
48
48
  "tools": "^0.0.1",
49
49
  "typedoc": "^0.24.8",
50
- "typescript": "^5.1.3"
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": "54e825a976c72067a244cff8725ca98f5416d26d\n"
90
+ "gitHead": "9fa3f7f8169efa30e3c71b43c82f77393581c3b5\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 = [...repeatedly((x) => x, numColumns)];
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");