File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/doxdox-parser-template/src Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,25 @@ import { join } from 'path';
44
55import { File } from 'doxdox-core' ;
66
7- export default async ( cwd : string , path : string ) : Promise < File > =>
8- await parseString ( path , await fs . readFile ( join ( cwd , path ) , 'utf8' ) ) ;
7+ const parser = async ( cwd : string , path : string ) : Promise < File > => {
8+ try {
9+ const content = await fs . readFile ( join ( cwd , path ) , 'utf8' ) ;
910
11+ return await parseString ( path , content ) ;
12+ } catch ( err ) {
13+ if ( process . env . DEBUG ) {
14+ console . error ( err ) ;
15+ }
16+ }
17+
18+ return { path, methods : [ ] } ;
19+ } ;
1020export const parseString = async (
1121 path : string ,
1222 // eslint-disable-next-line @typescript-eslint/no-unused-vars
1323 content : string
1424) : Promise < File > => {
1525 return { path, methods : [ ] } ;
1626} ;
27+
28+ export default parser ;
You can’t perform that action at this time.
0 commit comments