Added a check to ensure that source.url.path exists before iterating through them. (#66505)

This commit is contained in:
John Dorlus 2020-05-13 22:50:59 -04:00 committed by GitHub
parent 41d16f4daf
commit 8c36a37770
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,13 +37,16 @@ module.exports = spec => {
Object.keys(spec).forEach(api => {
const source = spec[api];
if (source.url.paths.every(path => Boolean(path.deprecated))) {
return;
}
if (!source.url) {
return result;
}
if (source.url.path) {
if (source.url.paths.every(path => Boolean(path.deprecated))) {
return;
}
}
const convertedSpec = (result[api] = {});
if (source.params) {
const urlParams = convertParams(source.params);