Skip to content

Commit

Permalink
Use promise-returning version of W3C API library
Browse files Browse the repository at this point in the history
  • Loading branch information
dontcallmedom committed Jan 12, 2022
1 parent 9f78f4b commit 9703803
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 75 deletions.
13 changes: 2 additions & 11 deletions lib/w3cData.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,8 @@ async function data() {
fetch("https://labs.w3.org/hatchery/repo-manager/api/repos").then(r => r.json()),
fetch("https://w3c.github.io/cg-monitor/report.json").then(r => r.json()),
fetch("https://w3c.github.io/spec-dashboard/repo-map.json").then(r => r.json()),
// https://github.com/w3c/node-w3capi/issues/41
new Promise((resolve, reject) => {
w3c.groups().fetch({embed: true}, (err, w3cgroups) => {
if (err) {
reject(err);
} else {
resolve(w3cgroups.map(g => {
return {...g, fullshortname: typeToShortType(g.type) + '/' + g.shortname};
}));
}
});
(await w3c.groups().fetch({embed: true}) || []).map(g => {
return {...g, fullshortname: typeToShortType(g.type) + '/' + g.shortname};
})
]);

Expand Down
221 changes: 167 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@octokit/core": "^3.5.1",
"@octokit/plugin-throttling": "^3.5.2",
"node-fetch": "^2.6.1",
"node-w3capi": "^1.8.0"
"node-w3capi": "^1.11.0"
},
"devDependencies": {
"eslint": "^6.8.0",
Expand Down
Loading

0 comments on commit 9703803

Please sign in to comment.