Skip to content

Commit dead5bb

Browse files
committed
Finish internal documentation
1 parent aadb8ad commit dead5bb

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

lib/commands/serve.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ server.on('listening', function () {
2424
process.stdout.write('documentation.js serving on port 4001\n');
2525
});
2626

27+
/**
28+
* Wrap the documentation build command along with a server, making it possible
29+
* to preview changes live
30+
* @private
31+
* @param {Object} documentation module instance
32+
* @param {Object} parsedArgs cli input
33+
* @returns {undefined} has side effects
34+
*/
2735
function serve(documentation, parsedArgs) {
2836
parsedArgs.commandOptions.format = 'html';
2937
build(documentation, parsedArgs, function (err, output) {

lib/infer/access.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
var shouldSkipInference = require('./should_skip_inference');
44

5-
module.exports = function (pattern) {
5+
/**
6+
* Given a string with a pattern that might infer access level, like `^_`,
7+
* create an inference method.
8+
*
9+
* @param {?string} pattern regexp-compatible pattern
10+
* @returns {Function} inference method
11+
* @private
12+
*/
13+
function inferAccessWithPattern(pattern) {
614
var re = pattern && new RegExp(pattern);
715

816
/**
@@ -21,4 +29,6 @@ module.exports = function (pattern) {
2129

2230
return comment;
2331
});
24-
};
32+
}
33+
34+
module.exports = inferAccessWithPattern;

lib/infer/membership.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ function extractIdentifiers(path) {
4343
var identifiers = [];
4444

4545
path.traverse({
46+
/**
47+
* Add an identifier in a path to the identifiers array
48+
* @param {Object} path ast path
49+
* @returns {undefined} has side-effects
50+
* @private
51+
*/
4652
Identifier: function (path) {
4753
identifiers.push(path.node.name);
4854
}

0 commit comments

Comments
 (0)