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';
4
4
5
5
import { File } from 'doxdox-core' ;
6
6
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' ) ;
9
10
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
+ } ;
10
20
export const parseString = async (
11
21
path : string ,
12
22
// eslint-disable-next-line @typescript-eslint/no-unused-vars
13
23
content : string
14
24
) : Promise < File > => {
15
25
return { path, methods : [ ] } ;
16
26
} ;
27
+
28
+ export default parser ;
You can’t perform that action at this time.
0 commit comments