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
42
42
43
43
** index.js**
44
44
45
- ``` javascript
45
+ ``` typescript
46
46
import { downloadFile , getRepoData , parseFiles } from ' doxdox-fetch' ;
47
47
48
48
import { parseString } from ' doxdox-parser-custom' ;
49
49
50
- import { Doc } from ' doxdox-core/dist/types ' ;
50
+ import { Doc } from ' doxdox-core' ;
51
51
52
52
(async () => {
53
53
const repoData = await getRepoData (username , repo , {
54
54
GITHUB_API_TOKEN: process .env .GITHUB_API_TOKEN_READONLY
55
55
});
56
56
57
- const currentBranch =
57
+ const selectedBranch =
58
58
branch && [repoData .default_branch , ... repoData .tags ].includes (branch )
59
59
? branch
60
60
: repoData .default_branch ;
61
61
62
- const files = await downloadFile (username, repo, currentBranch , [
63
- / . [jt] sx ? $ / ,
62
+ const files = await downloadFile (username , repo , selectedBranch , [
63
+ / . [jt] s $ / ,
64
64
/ package. json$ / ,
65
65
/ \. doxdoxignore$ /
66
66
]);
@@ -74,7 +74,7 @@ import { Doc } from 'doxdox-core/dist/types';
74
74
! path .match (/ __tests__\/ / )
75
75
);
76
76
77
- const pkgFile = files .find (({ path }) => path .match (/ package\. json$ / ));
77
+ const pkgFile = files .find (({ path }) => path .match (/ ^ package\. json$ / ));
78
78
79
79
const pkgFileContents = JSON .parse (pkgFile ?.content || ' {}' );
80
80
You can’t perform that action at this time.
0 commit comments