Skip to content

Commit 61fe583

Browse files
authored
πŸ”€ Merge pull request #3 from aynp/fix-structure-1
πŸ› Fix file structure
2 parents 60f9c4e + 20fa401 commit 61fe583

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,22 @@ The structure of genrated JSON is similar to the response of api.github.com/repo
2323

2424
```json
2525
{
26-
"name": {
27-
"name": "name",
28-
"path": "path",
29-
"sha": "sha",
30-
"size": 0,
31-
"url": "dir_url",
32-
"html_url": "html_url",
33-
"git_url": "git_url",
34-
"download_url": null,
35-
"type": "dir",
36-
"_links": {
37-
"self": "self_url",
38-
"git": "git_url",
39-
"html": "html_url"
40-
}
41-
},
26+
"name": "name",
27+
"path": "path",
28+
"sha": "sha",
29+
"size": 0,
30+
"url": "dir_url",
31+
"html_url": "html_url",
32+
"git_url": "git_url",
33+
"download_url": null,
34+
"type": "dir",
35+
"_links": {
36+
"self": "self_url",
37+
"git": "git_url",
38+
"html": "html_url"
39+
}
4240
"contents": [
43-
// contents of the directory
41+
{}
4442
]
4543
}
4644
```

β€Žpackage-lock.jsonβ€Ž

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-to-json",
3-
"version": "1.0.4",
3+
"version": "v2.0.0",
44
"description": "Repository to JSON using GitHub API",
55
"main": "index.js",
66
"type": "module",

β€Žparse.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function rec(octokit, url) {
1010
const item = data[i];
1111
if (item.type === 'dir') {
1212
const temp = await rec(octokit, item.url);
13-
result.push({ name: item, contents: temp });
13+
result.push({ ...item, contents: temp });
1414
} else {
1515
result.push(item);
1616
}

0 commit comments

Comments
Β (0)