Skip to content
Snippets Groups Projects
Commit f1a8e56f authored by Michael Kriese's avatar Michael Kriese Committed by Rhys Arkins
Browse files

fix(nuget): use optimised xml functions (#4231)

fix(nuget): use optimised xml functions
parent f2119397
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,7 @@ async function getPkgReleases(feedUrl, pkgName) {
const pkgVersionsListDoc = new XmlDocument(pkgVersionsListRaw.body);
const pkgInfoList = pkgVersionsListDoc.children.filter(
// @ts-ignore
node => node.name === 'entry'
);
const pkgInfoList = pkgVersionsListDoc.childrenNamed('entry');
for (const pkgInfo of pkgInfoList || []) {
const pkgVersion = getPkgProp(pkgInfo, 'Version');
......@@ -50,12 +47,10 @@ async function getPkgReleases(feedUrl, pkgName) {
}
}
const nextPkgUrlListLink = pkgVersionsListDoc.children.find(
// @ts-ignore
node => node.name === 'link' && node.attr.rel === 'next'
);
const nextPkgUrlListLink = pkgVersionsListDoc
.childrenNamed('link')
.find(node => node.attr.rel === 'next');
// @ts-ignore
pkgUrlList = nextPkgUrlListLink ? nextPkgUrlListLink.attr.href : null;
} while (pkgUrlList !== null);
......@@ -70,7 +65,5 @@ async function getPkgReleases(feedUrl, pkgName) {
}
function getPkgProp(pkgInfo, propName) {
return pkgInfo.children
.find(child => child.name === 'm:properties')
.children.find(child => child.name === `d:${propName}`).val;
return pkgInfo.childNamed('m:properties').childNamed(`d:${propName}`).val;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment