Skip to content

Commit d1e5baf

Browse files
committed
more documentation improvements
1 parent 7dad60b commit d1e5baf

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

lib/flow_doctrine.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ var literalTypes = {
1717
'BooleanLiteralTypeAnnotation': 'BooleanLiteral'
1818
};
1919

20+
/**
21+
* Babel parses Flow annotations in JavaScript into AST nodes. documentation.js uses
22+
* Babel to parse JavaScript. This method restructures those Babel-generated
23+
* objects into objects that fit the output of Doctrine, the module we use
24+
* to parse JSDoc annotations. This lets us use Flow annotations _as_
25+
* JSDoc annotations.
26+
*
27+
* @private
28+
* @param {Object} type babel-parsed flow type
29+
* @returns {Object} doctrine compatible type
30+
*/
2031
function flowDoctrine(type) {
2132

2233
if (type.type in namedTypes) {

lib/inline_tokenizer.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
'use strict';
22

3+
/**
4+
* Create a tokenizer method for Remark, our Markdown processor,
5+
* that is able to parse JSDoc inline tokens
6+
*
7+
* @private
8+
* @param {string} type the destination type of the parsed objects
9+
* @param {RegExp} regex regular expression for extracting content
10+
* from text
11+
* @returns {Function} tokenizer
12+
*/
313
function makeTokenizer(type, regex) {
414
var tokenizer = function (eat, value, silent) {
515
var match = regex.exec(value);

lib/server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ Server.prototype.stop = function (callback) {
100100
}.bind(this));
101101
};
102102

103+
/**
104+
* A placeholder method that will be called instead of `callback` if
105+
* callback is omitted for the server control methods
106+
* @private
107+
* @returns {undefined} doesn't return anything
108+
*/
103109
function noop() {}
104110

105111
module.exports = Server;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy