File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,25 +42,25 @@ GITHUB_API_TOKEN_READONLY=xxxxx
4242
4343** index.js**
4444
45- ``` javascript
45+ ``` typescript
4646import { downloadFile , getRepoData , parseFiles } from ' doxdox-fetch' ;
4747
4848import { parseString } from ' doxdox-parser-custom' ;
4949
50- import { Doc } from ' doxdox-core/dist/types ' ;
50+ import { Doc } from ' doxdox-core' ;
5151
5252(async () => {
5353 const repoData = await getRepoData (username , repo , {
5454 GITHUB_API_TOKEN: process .env .GITHUB_API_TOKEN_READONLY
5555 });
5656
57- const currentBranch =
57+ const selectedBranch =
5858 branch && [repoData .default_branch , ... repoData .tags ].includes (branch )
5959 ? branch
6060 : repoData .default_branch ;
6161
62- const files = await downloadFile (username, repo, currentBranch , [
63- / . [jt] sx ? $ / ,
62+ const files = await downloadFile (username , repo , selectedBranch , [
63+ / . [jt] s $ / ,
6464 / package. json$ / ,
6565 / \. doxdoxignore$ /
6666 ]);
@@ -74,7 +74,7 @@ import { Doc } from 'doxdox-core/dist/types';
7474 ! path .match (/ __tests__\/ / )
7575 );
7676
77- const pkgFile = files .find (({ path }) => path .match (/ package\. json$ / ));
77+ const pkgFile = files .find (({ path }) => path .match (/ ^ package\. json$ / ));
7878
7979 const pkgFileContents = JSON .parse (pkgFile ?.content || ' {}' );
8080
You can’t perform that action at this time.
0 commit comments