@@ -37,7 +37,7 @@ function jsonAPI({ filename }) {
37
37
const metaExpr = / < ! - - ( [ ^ = ] + ) = ( [ ^ - ] + ) - - > \n * / g;
38
38
const stabilityExpr = / ^ S t a b i l i t y : ( [ 0 - 5 ] ) (?: \s * - \s * ) ? ( .* ) $ / s;
39
39
40
- // extract definitions
40
+ // Extract definitions.
41
41
const definitions = select ( tree , 'definition' ) ;
42
42
43
43
// Determine the start, stop, and depth of each section.
@@ -82,7 +82,7 @@ function jsonAPI({ filename }) {
82
82
// Extract (and remove) metadata that is not directly inferable
83
83
// from the markdown itself.
84
84
nodes . forEach ( ( node , i ) => {
85
- // Input: <!-- name=module -->; output: {name: module}
85
+ // Input: <!-- name=module -->; output: {name: module}.
86
86
if ( node . type === 'html' ) {
87
87
node . value = node . value . replace ( metaExpr , ( _0 , key , value ) => {
88
88
current [ key . trim ( ) ] = value . trim ( ) ;
@@ -100,7 +100,7 @@ function jsonAPI({ filename }) {
100
100
delete nodes [ i ] ;
101
101
}
102
102
103
- // Stablility marker: > Stability: ...
103
+ // Stability marker: > Stability: ...
104
104
if (
105
105
node . type === 'blockquote' && node . children . length === 1 &&
106
106
node . children [ 0 ] . type === 'paragraph' &&
@@ -209,8 +209,7 @@ function jsonAPI({ filename }) {
209
209
. trim ( ) . replace ( / \s + / g, '_' ) ;
210
210
}
211
211
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.
214
213
let plur ;
215
214
if ( current . type . slice ( - 1 ) === 's' ) {
216
215
plur = `${ current . type } es` ;
@@ -272,8 +271,8 @@ function jsonAPI({ filename }) {
272
271
} ) ;
273
272
}
274
273
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
277
276
// shares a name and is lacking a description, copy it backwards.
278
277
if ( ! parent [ plur ] ) parent [ plur ] = [ ] ;
279
278
const prev = parent [ plur ] . slice ( - 1 ) [ 0 ] ;
@@ -328,7 +327,7 @@ function parseSignature(text, sig) {
328
327
sigParam = sigParam . substr ( 0 , eq ) ;
329
328
}
330
329
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.
332
331
// Example: shared signatures for:
333
332
// ### new Console(stdout[, stderr][, ignoreErrors])
334
333
// ### new Console(options)
@@ -429,9 +428,9 @@ function parseListItem(item, file) {
429
428
return current ;
430
429
}
431
430
432
- // This section parse out the contents of an H# tag.
431
+ // This section parses out the contents of an H# tag.
433
432
434
- // To reduse escape slashes in RegExp string components.
433
+ // To reduce escape slashes in RegExp string components.
435
434
const r = String . raw ;
436
435
437
436
const eventPrefix = '^Event: +' ;
0 commit comments