@thi.ng/transclude 0.1.69 → 0.1.70

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**: 2024-02-22T11:59:16Z
3
+ - **Last updated**: 2024-02-22T23:15:26Z
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.1.70](https://github.com/thi-ng/umbrella/tree/@thi.ng/transclude@0.1.70) (2024-02-22)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update object destructuring in all pkgs & examples ([f36aeb0](https://github.com/thi-ng/umbrella/commit/f36aeb0))
17
+
12
18
  ### [0.1.69](https://github.com/thi-ng/umbrella/tree/@thi.ng/transclude@0.1.69) (2024-02-22)
13
19
 
14
20
  #### ♻️ Refactoring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/transclude",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "description": "Extensible functional template engine for text document generation, incl. various high-level Markdown features",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -37,10 +37,10 @@
37
37
  "dependencies": {
38
38
  "@thi.ng/api": "^8.9.25",
39
39
  "@thi.ng/checks": "^3.5.0",
40
- "@thi.ng/file-io": "^1.3.2",
40
+ "@thi.ng/file-io": "^1.3.3",
41
41
  "@thi.ng/logger": "^3.0.2",
42
42
  "@thi.ng/strings": "^3.7.16",
43
- "@thi.ng/transducers": "^8.9.5"
43
+ "@thi.ng/transducers": "^8.9.6"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.40.1",
@@ -110,5 +110,5 @@
110
110
  "status": "alpha",
111
111
  "year": 2022
112
112
  },
113
- "gitHead": "4513a1c703bdbf0f0867f03e547e47692e415fac\n"
113
+ "gitHead": "16f2b92b5410bd35dcde6c2971c8e62783ebc472\n"
114
114
  }
package/tpl/markdown.d.ts CHANGED
@@ -19,6 +19,18 @@ export interface TOCOpts {
19
19
  *
20
20
  */
21
21
  title: string;
22
+ /**
23
+ * Placeholder pattern for injected TOC
24
+ *
25
+ * @defaultValue "\<!-- toc --\>"
26
+ */
27
+ match: string | RegExp;
28
+ /**
29
+ * Test pattern for disabling TOC. If this pattern is found no TOC will be injected.
30
+ *
31
+ * @defaultValue "\<!-- notoc --\>"
32
+ */
33
+ disable: RegExp;
22
34
  }
23
35
  /**
24
36
  * Higher order, configurable post-processing template function. Injects a table
package/tpl/markdown.js CHANGED
@@ -13,14 +13,14 @@ const list = (items, eol = "\n") => transduce(
13
13
  str(eol),
14
14
  items
15
15
  );
16
- const toc = (opts) => ({ src, eol }) => {
17
- const { min, max, match, disable, title } = {
18
- min: 2,
19
- max: 4,
20
- match: "<!-- toc -->",
21
- disable: /<\!-- notoc -->/i,
22
- ...opts
23
- };
16
+ const toc = (opts = {}) => ({ src, eol }) => {
17
+ const {
18
+ min = 2,
19
+ max = 4,
20
+ match = /<\!-- toc -->/i,
21
+ disable = /<\!-- notoc -->/i,
22
+ title
23
+ } = opts;
24
24
  const isHeading = new RegExp(`^#{${min},${max}}\\s`);
25
25
  const reHeading = new RegExp(`^(#{${min},${max}})\\s(.+)`);
26
26
  const toc2 = transduce(