@@ -38,27 +38,27 @@ function processExportDoc(exportDoc) {
38
38
stability = 'deprecated' ;
39
39
exportDoc . showDeprecatedNotes = true ;
40
40
}
41
-
41
+
42
42
var howToUse = '' ;
43
43
if ( _ . has ( exportDoc , 'howToUse' ) ) {
44
44
var howToUseArray = exportDoc . tags . tags . filter ( function ( tag ) {
45
45
return tag . tagName === 'howToUse'
46
46
} ) ;
47
-
47
+
48
48
// Remove line breaks, there should only be one tag
49
49
howToUse = howToUseArray [ 0 ] . description . replace ( / ( \r \n | \n | \r ) / gm, " " ) ;
50
50
}
51
-
51
+
52
52
var whatItDoes = '' ;
53
53
if ( _ . has ( exportDoc , 'whatItDoes' ) ) {
54
54
var whatItDoesArray = exportDoc . tags . tags . filter ( function ( tag ) {
55
55
return tag . tagName === 'whatItDoes'
56
56
} ) ;
57
-
57
+
58
58
// Remove line breaks, there should only be one tag
59
59
whatItDoes = whatItDoesArray [ 0 ] . description . replace ( / ( \r \n | \n | \r ) / gm, " " ) ;
60
60
}
61
-
61
+
62
62
// SECURITY STATUS
63
63
// Supported tags:
64
64
// @security
@@ -68,13 +68,13 @@ function processExportDoc(exportDoc) {
68
68
var securityArray = exportDoc . tags . tags . filter ( function ( tag ) {
69
69
return tag . tagName === 'security'
70
70
} ) ;
71
-
71
+
72
72
// Remove line breaks, there should only be one tag
73
73
security = securityArray [ 0 ] . description . replace ( / ( \r \n | \n | \r ) / gm, " " ) ;
74
-
74
+
75
75
exportDoc . showSecurityNotes = true ;
76
76
}
77
-
77
+
78
78
return { stability : stability , howToUse : howToUse , whatItDoes : whatItDoes , security : security } ;
79
79
}
80
80
@@ -110,7 +110,7 @@ module.exports = function addJadeDataDocsProcessor() {
110
110
*
111
111
* Modules must be public and have content
112
112
*/
113
-
113
+
114
114
_ . forEach ( docs , function ( doc ) {
115
115
if ( doc . docType === 'module' && ! doc . internal && doc . exports . length ) {
116
116
modules . push ( doc ) ;
@@ -124,15 +124,15 @@ module.exports = function addJadeDataDocsProcessor() {
124
124
intro : doc . description . replace ( '"' , '\"' ) . replace ( / \s * ( \r ? \n | \r ) \s * / g, " " ) ,
125
125
docType : 'module'
126
126
} ] ;
127
-
127
+
128
128
var decorators = { } ;
129
-
129
+
130
130
// GET DATA FOR EACH PAGE (CLASS, VARS, FUNCTIONS)
131
131
var modulePageInfo = _ ( doc . exports )
132
132
. map ( function ( exportDoc ) {
133
133
// if it ends with "Decorator", we store it in the map
134
134
// to later merge with the token
135
- if ( exportDoc . name . endsWith ( "Decorator" ) ) {
135
+ if ( exportDoc . name . endsWith ( "Decorator" ) && exportDoc . callMember ) {
136
136
var p = processExportDoc ( exportDoc . callMember ) ;
137
137
decorators [ exportDoc . name ] = {
138
138
stability : p . stability ,
@@ -146,7 +146,7 @@ module.exports = function addJadeDataDocsProcessor() {
146
146
147
147
} else {
148
148
var p = processExportDoc ( exportDoc ) ;
149
-
149
+
150
150
// Data inserted into jade-data.template.html
151
151
var dataDoc = {
152
152
name : exportDoc . name + '-' + exportDoc . docType ,
@@ -158,23 +158,23 @@ module.exports = function addJadeDataDocsProcessor() {
158
158
whatItDoes : p . whatItDoes ,
159
159
security : p . security
160
160
} ;
161
-
161
+
162
162
if ( exportDoc . symbolTypeName ) dataDoc . varType = titleCase ( exportDoc . symbolTypeName ) ;
163
163
if ( exportDoc . originalModule ) dataDoc . originalModule = exportDoc . originalModule ;
164
-
164
+
165
165
return dataDoc ;
166
166
}
167
167
} )
168
168
. filter ( function ( s ) { return ! ! s ; } ) // filter out all null values
169
169
. sortBy ( 'name' )
170
170
. value ( ) ;
171
-
171
+
172
172
// find a matching symbol for every decorator item
173
173
// and merge the data
174
174
_ . forEach ( Object . keys ( decorators ) , function ( name ) {
175
175
var varToken = name . split ( "Decorator" ) [ 0 ] ;
176
176
var c = modulePageInfo . filter ( function ( n ) { return n . exportDoc . name === varToken ; } ) ;
177
-
177
+
178
178
c [ 0 ] . docType = decorators [ name ] . docType ;
179
179
Object . assign ( c [ 0 ] . exportDoc , decorators [ name ] ) ;
180
180
} ) ;
0 commit comments