File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ function addDataToSwaggerObject(swaggerObject, data) {
126
126
}
127
127
}
128
128
129
+ /**
130
+ * Converts an array of globs to full paths
131
+ * @function
132
+ * @param {array } globs - Array of globs and/or normal paths
133
+ * @return {array } Array of fully-qualified paths
134
+ * @requires glob
135
+ */
136
+ function convertGlobPaths ( globs ) {
137
+ return globs . reduce ( function ( acc , globString ) {
138
+ var globFiles = glob . sync ( globString ) ;
139
+ return acc . concat ( globFiles ) ;
140
+ } , [ ] ) ;
141
+ }
142
+
129
143
/**
130
144
* Generates the swagger spec
131
145
* @function
@@ -153,11 +167,7 @@ module.exports = function(options) {
153
167
swaggerObject . parameters = { } ;
154
168
swaggerObject . securityDefinitions = { } ;
155
169
156
- // Build up the array of file names
157
- var apiPaths = options . apis . reduce ( function ( acc , file ) {
158
- var globFiles = glob . sync ( file ) ;
159
- return acc . concat ( globFiles ) ;
160
- } , [ ] ) ;
170
+ var apiPaths = convertGlobPaths ( options . apis ) ;
161
171
162
172
// Parse the documentation in the APIs array.
163
173
for ( var i = 0 ; i < apiPaths . length ; i = i + 1 ) {
You can’t perform that action at this time.
0 commit comments