Switch to async/await
This commit is contained in:
parent
87459b2acc
commit
18021e0ef8
10 changed files with 53 additions and 8837 deletions
|
@ -10,13 +10,13 @@ fs.readdirSync(path.join(__dirname, 'services')).forEach(function(file) {
|
|||
}
|
||||
});
|
||||
|
||||
export default function* (url) {
|
||||
export default async function (url) {
|
||||
let matchedService;
|
||||
for (let service of services) {
|
||||
matchedService = service.match(url);
|
||||
if (matchedService) {
|
||||
const result = yield service.parseUrl(url);
|
||||
return yield service.lookupId(result.id, result.type);
|
||||
const result = await service.parseUrl(url);
|
||||
return await service.lookupId(result.id, result.type);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue