Skip to content

Commit 93d2044

Browse files
committed
address comment nits
1 parent 81d3985 commit 93d2044

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tools/doc/json.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function jsonAPI({ filename }) {
3737
const metaExpr = /<!--([^=]+)=([^-]+)-->\n*/g;
3838
const stabilityExpr = /^Stability: ([0-5])(?:\s*-\s*)?(.*)$/s;
3939

40-
// extract definitions
40+
// Extract definitions.
4141
const definitions = select(tree, 'definition');
4242

4343
// Determine the start, stop, and depth of each section.
@@ -82,7 +82,7 @@ function jsonAPI({ filename }) {
8282
// Extract (and remove) metadata that is not directly inferable
8383
// from the markdown itself.
8484
nodes.forEach((node, i) => {
85-
// Input: <!-- name=module -->; output: {name: module}
85+
// Input: <!-- name=module -->; output: {name: module}.
8686
if (node.type === 'html') {
8787
node.value = node.value.replace(metaExpr, (_0, key, value) => {
8888
current[key.trim()] = value.trim();
@@ -100,7 +100,7 @@ function jsonAPI({ filename }) {
100100
delete nodes[i];
101101
}
102102

103-
// Stablility marker: > Stability: ...
103+
// Stability marker: > Stability: ...
104104
if (
105105
node.type === 'blockquote' && node.children.length === 1 &&
106106
node.children[0].type === 'paragraph' &&
@@ -209,8 +209,7 @@ function jsonAPI({ filename }) {
209209
.trim().replace(/\s+/g, '_');
210210
}
211211

212-
// Pluralize type to determine which 'bucket' to put this section
213-
// in.
212+
// Pluralize type to determine which 'bucket' to put this section in.
214213
let plur;
215214
if (current.type.slice(-1) === 's') {
216215
plur = `${current.type}es`;
@@ -272,8 +271,8 @@ function jsonAPI({ filename }) {
272271
});
273272
}
274273

275-
// Add this section to the parent. Sometimes we have two headings with a
276-
// single blob of description. If the preceding entry at this level
274+
// Add this section to the parent. Sometimes we have two headings with a
275+
// single blob of description. If the preceding entry at this level
277276
// shares a name and is lacking a description, copy it backwards.
278277
if (!parent[plur]) parent[plur] = [];
279278
const prev = parent[plur].slice(-1)[0];
@@ -328,7 +327,7 @@ function parseSignature(text, sig) {
328327
sigParam = sigParam.substr(0, eq);
329328
}
330329

331-
// At this point, the name should match. If it doesn't find one that does.
330+
// At this point, the name should match. If it doesn't find one that does.
332331
// Example: shared signatures for:
333332
// ### new Console(stdout[, stderr][, ignoreErrors])
334333
// ### new Console(options)
@@ -429,9 +428,9 @@ function parseListItem(item, file) {
429428
return current;
430429
}
431430

432-
// This section parse out the contents of an H# tag.
431+
// This section parses out the contents of an H# tag.
433432

434-
// To reduse escape slashes in RegExp string components.
433+
// To reduce escape slashes in RegExp string components.
435434
const r = String.raw;
436435

437436
const eventPrefix = '^Event: +';

0 commit comments

Comments
 (0)