rehype-custom-toc 1.1.4 → 1.1.5

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -2
  2. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import GitHubSlugger from "github-slugger";
2
2
  import { fromHtml } from "hast-util-from-html";
3
3
  import { h } from "hastscript";
4
- import { isNonEmptyArray } from "@robot-inventor/ts-utils";
5
4
  import { toHtml } from "hast-util-to-html";
6
5
  import { toText } from "hast-util-to-text";
7
6
  import { visit } from "unist-util-visit";
@@ -93,7 +92,7 @@ const generateToc = (tree, options) => {
93
92
  text
94
93
  });
95
94
  });
96
- if (!isNonEmptyArray(headings))
95
+ if (!headings[0])
97
96
  return [];
98
97
  let currentDepth = headings[0].depth;
99
98
  let currentParent = toc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rehype-custom-toc",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "rehype plugin to generate a customizable table of contents",
5
5
  "keywords": [
6
6
  "rehype",
@@ -39,7 +39,6 @@
39
39
  "ci:publish": "npm run build && changeset publish"
40
40
  },
41
41
  "dependencies": {
42
- "@robot-inventor/ts-utils": "^0.8.9",
43
42
  "github-slugger": "^2.0.0",
44
43
  "hast-util-from-html": "^2.0.3",
45
44
  "hast-util-to-html": "^9.0.5",
@@ -52,18 +51,18 @@
52
51
  "devDependencies": {
53
52
  "@changesets/changelog-github": "^1.0.1",
54
53
  "@changesets/cli": "^3.0.3",
55
- "@robot-inventor/oxlint-config": "^0.4.0",
54
+ "@robot-inventor/oxlint-config": "^0.5.2",
56
55
  "@robot-inventor/tsconfig-base": "^7.2.0",
57
56
  "@types/hast": "^3.0.5",
58
57
  "cross-env": "^10.1.0",
59
- "oxlint": "^1.85.0",
60
- "prettier": "^3.9.8",
58
+ "oxlint": "^1.89.0",
59
+ "prettier": "^3.9.10",
61
60
  "rehype-parse": "^9.0.1",
62
61
  "rehype-stringify": "^10.0.1",
63
62
  "remark-comment": "^1.0.0",
64
63
  "remark-parse": "^11.0.0",
65
64
  "remark-rehype": "^11.1.2",
66
65
  "typescript": "^7.0.2",
67
- "vitest": "^5.0.1"
66
+ "vitest": "^5.0.5"
68
67
  }
69
68
  }