misc(v2): clean up comments in code (#2294)

This commit is contained in:
Yangshun Tay 2020-02-18 21:29:23 +08:00 committed by GitHub
parent d7f3dff6e6
commit 996b115199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 234 additions and 155 deletions

View file

@ -29,12 +29,13 @@ function toValue(node) {
default:
}
}
return toString(node);
}
// Visit all headings. We `slug` all headings (to account for
// duplicates), but only take h2 and h3 headings.
const search = node => {
function search(node) {
const headings = [];
let current = -1;
let currentDepth = 0;
@ -65,6 +66,6 @@ const search = node => {
visit(node, 'heading', onHeading);
return headings;
};
}
module.exports = search;