diff --git a/src/ssn/parsePatchmanifest.ts b/src/ssn/parsePatchmanifest.ts index 9c93d87..a614a53 100644 --- a/src/ssn/parsePatchmanifest.ts +++ b/src/ssn/parsePatchmanifest.ts @@ -11,10 +11,20 @@ export default function parsePatchManifest(manifestFile: any): any { //053678f8057e52896a8145dca5c188ab3f24fa55f const Releases = PatchManifest.elements[7]; - out.releases = Releases.elements.map((Release: any) => ({ id: Release.elements[0].elements[0].text, sha1: Release.elements[1].elements[0].text })); + out.releases = {}; + Releases.elements.forEach((Release: any) => { + const id = Release.elements[0].elements[0].text; + const sha1 = Release.elements[1].elements[0].text; + out.releases[id] = { sha1, from: [], to: [] }; + }); const ReleaseUpdatePaths = PatchManifest.elements[8]; - out.paths = ReleaseUpdatePaths.elements.map((ReleaseUpdatePath: any) => ({ from: ReleaseUpdatePath.elements[0].elements[0].text, to: ReleaseUpdatePath.elements[1].elements[0].text })); + ReleaseUpdatePaths.elements.forEach((ReleaseUpdatePath: any) => { + const from = ReleaseUpdatePath.elements[0].elements[0].text; + const to = ReleaseUpdatePath.elements[1].elements[0].text; + out.releases[from].to.push(to); + out.releases[to].from.push(from); + }); return out; }