File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * This takes a number and a callback and calls the callback with the number
3
+ * plus 3.
4
+ *
5
+ * @param {Number } n - The number.
6
+ * @param {simpleCallback } cb - The callback.
7
+ */
8
+ function takesSimpleCallback ( n , cb ) {
9
+ cb ( null , n + 3 ) ;
10
+ }
11
+
12
+ /**
13
+ * This callback takes an error and a number.
14
+ *
15
+ * @callback simpleCallback
16
+ * @param {?Error } err - The error.
17
+ * @param {Number } n - The number.
18
+ */
Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ var fs = require('fs'),
9
9
LinkerStack = require ( '../' ) . util . LinkerStack ,
10
10
hljs = require ( 'highlight.js' ) ;
11
11
12
+ function isFunction ( section ) {
13
+ return (
14
+ section . kind === 'function' ||
15
+ ( section . kind === 'typedef' &&
16
+ section . type . type === 'NameExpression' &&
17
+ section . type . name === 'Function' )
18
+ ) ;
19
+ }
20
+
12
21
module . exports = function (
13
22
comments : Array < Comment > ,
14
23
config : DocumentationConfig
@@ -34,7 +43,7 @@ module.exports = function(
34
43
var prefix = '' ;
35
44
if ( section . kind === 'class' ) {
36
45
prefix = 'new ' ;
37
- } else if ( section . kind !== 'function' ) {
46
+ } else if ( ! isFunction ( section ) ) {
38
47
return section . name ;
39
48
}
40
49
return prefix + section . name + formatters . parameters ( section , true ) ;
@@ -44,7 +53,7 @@ module.exports = function(
44
53
var prefix = '' ;
45
54
if ( section . kind === 'class' ) {
46
55
prefix = 'new ' ;
47
- } else if ( section . kind !== 'function' ) {
56
+ } else if ( ! isFunction ( section ) ) {
48
57
return section . name ;
49
58
}
50
59
if ( section . returns . length ) {
You can’t perform that action at this time.
0 commit comments