Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
object => set
  • Loading branch information
rubys committed Jul 19, 2018
commit fc0c16de6a7c7ed8a7fa67beba73886a93a035d9
6 changes: 3 additions & 3 deletions tools/doc/allhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +
fs.writeFileSync(source + '/all.html', all, 'utf8');

// Validate all hrefs have a target
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: a period in the end.

const ids = {};
const ids = new Set();
all.replace(/ id="(\w+)"/g, (_text, id) => {
ids[id] = true;
ids.add(id);
});

all.replace(/ href="#(\w+)"/g, (_text, href) => {
if (!ids[href]) throw new Error(`link not found: ${href}`);
if (!ids.has(href)) throw new Error(`link not found: ${href}`);
});