Skip to content

Commit 597a05a

Browse files
authored
Merge pull request #202 from docsbydoxdox/hotfix/update-template-package
[hotfix] Updated template package parser method to match other parsers.
2 parents 64cedff + 8720836 commit 597a05a

File tree

1 file changed

+14
-2
lines changed
  • packages/doxdox-parser-template/src

1 file changed

+14
-2
lines changed

packages/doxdox-parser-template/src/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ import { join } from 'path';
44

55
import { 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+
};
1020
export 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;

0 commit comments

Comments
 (0)