@@ -15,7 +15,7 @@ export default (
1515 path : string ,
1616 modules : Array < Module > ,
1717 directories : Array < Directory > ,
18- startdirectoryShortid : ?string = undefined
18+ startdirectoryShortid : ?string = undefined ,
1919) => {
2020 // Split path
2121 const splitPath = path . replace ( / ^ .\/ / , '' ) . split ( '/' ) ;
@@ -35,46 +35,46 @@ export default (
3535 // For == check on null
3636 // eslint-disable-next-line eqeqeq
3737 const directoriesInDirectory = directories . filter (
38- m => m . directoryShortid == dirId
38+ m => m . directoryShortid == dirId ,
3939 ) ;
4040 const nextDirectory = directoriesInDirectory . find ( d =>
41- compareTitle ( d . title , pathPart )
41+ compareTitle ( d . title , pathPart ) ,
4242 ) ;
4343
4444 if ( nextDirectory == null )
4545 throw new Error ( `Cannot find module in ${ path } ` ) ;
4646
47- return nextDirectory . id ;
47+ return nextDirectory . shortid ;
4848 } ,
49- startdirectoryShortid
49+ startdirectoryShortid ,
5050 ) ;
5151
5252 const lastPath = splitPath [ splitPath . length - 1 ] ;
5353 // eslint-disable-next-line eqeqeq
5454 const modulesInFoundDirectory = modules . filter (
55- m => m . directoryShortid == founddirectoryShortid
55+ m => m . directoryShortid == founddirectoryShortid ,
5656 ) ;
5757
5858 // Find module with same name
5959 const foundModule = modulesInFoundDirectory . find ( m =>
60- compareTitle ( m . title , lastPath )
60+ compareTitle ( m . title , lastPath ) ,
6161 ) ;
6262 if ( foundModule ) return foundModule ;
6363
6464 // eslint-disable-next-line eqeqeq
6565 const directoriesInFoundDirectory = directories . filter (
66- m => m . directoryShortid == founddirectoryShortid
66+ m => m . directoryShortid == founddirectoryShortid ,
6767 ) ;
6868 const foundDirectory = directoriesInFoundDirectory . find ( m =>
69- compareTitle ( m . title , lastPath )
69+ compareTitle ( m . title , lastPath ) ,
7070 ) ;
7171
7272 if ( foundDirectory ) {
7373 // eslint-disable-next-line eqeqeq
7474 const indexModule = modules . find (
7575 m =>
7676 m . directoryShortid == foundDirectory . id &&
77- compareTitle ( m . title , 'index' )
77+ compareTitle ( m . title , 'index' ) ,
7878 ) ;
7979 if ( indexModule == null ) throw new Error ( `Cannot find module in ${ path } ` ) ;
8080 return indexModule ;
@@ -83,7 +83,7 @@ export default (
8383 if ( splitPath [ splitPath . length - 1 ] === '' ) {
8484 // Last resort, check if there is something in the same folder called index
8585 const indexModule = modulesInFoundDirectory . find ( m =>
86- compareTitle ( m . title , 'index' )
86+ compareTitle ( m . title , 'index' ) ,
8787 ) ;
8888 if ( indexModule ) return indexModule ;
8989 }
0 commit comments