@@ -253,33 +253,24 @@ function sortNav(members) {
253253
254254function buildCategories ( members , templatePath ) {
255255 var categories = { } ;
256- if ( language === 'en' ) {
257- var exists = fs . existsSync ( path . resolve ( templatePath , "categories.json" ) ) ;
258- if ( exists ) {
259- categories = JSON . parse ( fs . readFileSync ( path . resolve ( templatePath , "categories.json" ) ) ) ;
260- } else {
261- logger . error ( 'Please generate a Chinese JSdoc first' )
262- }
263- } else {
264- _ . each ( members , function ( v ) {
256+ _ . each ( members , function ( v ) {
265257
266- var category = getCustomTagValue ( v , 'category' ) ;
267- if ( ! category ) {
268- category = "BaseTypes" ;
269- }
270- var arr = category . split ( " " ) ;
271- var aa = categories ;
272- for ( let index = 0 ; index < arr . length ; index ++ ) {
273- const element = arr [ index ] ;
274- if ( ! aa [ element ] ) {
275- aa [ element ] = { } ;
276- aa [ element ] . default = [ ] ;
277- }
278- aa = aa [ element ] ;
258+ var category = getCustomTagValue ( v , 'category' ) ;
259+ if ( ! category ) {
260+ category = "BaseTypes" ;
261+ }
262+ var arr = category . split ( " " ) ;
263+ var aa = categories ;
264+ for ( let index = 0 ; index < arr . length ; index ++ ) {
265+ const element = arr [ index ] ;
266+ if ( ! aa [ element ] ) {
267+ aa [ element ] = { } ;
268+ aa [ element ] . default = [ ] ;
279269 }
280- aa . default . push ( v . longname ) ;
281- } ) ;
282- }
270+ aa = aa [ element ] ;
271+ }
272+ aa . default . push ( v . longname ) ;
273+ } ) ;
283274 var outpath = path . resolve ( templatePath , "categories.json" ) ;
284275 fs . writeFileSync ( outpath , JSON . stringify ( categories ) , 'utf8' ) ;
285276 return categories ;
0 commit comments