Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ff375b

Browse filesBrowse files
targosdanielleadams
authored andcommitted
tools: avoid pending deprecation in doc generator
`unist-util-find` depends on `lodash.iteratee` which uses `process.binding()`. Let's remove this dependency which is used in one place to do a very simple thing. PR-URL: #37267 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent d96a97a commit 1ff375b
Copy full SHA for 1ff375b

File tree

Expand file treeCollapse file tree

3 files changed

+7
-86
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-86
lines changed
Open diff view settings
Collapse file

‎tools/doc/html.js‎

Copy file name to clipboardExpand all lines: tools/doc/html.js
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
const common = require('./common.js');
2525
const fs = require('fs');
2626
const unified = require('unified');
27-
const find = require('unist-util-find');
2827
const visit = require('unist-util-visit');
2928
const markdown = require('remark-parse');
3029
const gfm = require('remark-gfm');
@@ -97,7 +96,13 @@ function toHTML({ input, content, filename, nodeVersion, versions }) {
9796
// Set the section name based on the first header. Default to 'Index'.
9897
function firstHeader() {
9998
return (tree, file) => {
100-
const heading = find(tree, { type: 'heading' });
99+
let heading;
100+
visit(tree, (node) => {
101+
if (node.type === 'heading') {
102+
heading = node;
103+
return false;
104+
}
105+
});
101106

102107
if (heading && heading.children.length) {
103108
const recursiveTextContent = (node) =>
Collapse file

‎tools/doc/package-lock.json‎

Copy file name to clipboardExpand all lines: tools/doc/package-lock.json
-83Lines changed: 0 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎tools/doc/package.json‎

Copy file name to clipboardExpand all lines: tools/doc/package.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"remark-rehype": "8.0.0",
1818
"to-vfile": "6.1.0",
1919
"unified": "9.2.0",
20-
"unist-util-find": "^1.0.2",
2120
"unist-util-select": "3.0.4",
2221
"unist-util-visit": "2.0.3"
2322
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.