Skip to content

Commit

Permalink
fix: order of arguments in isPackageNewer function
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed Aug 15, 2024
1 parent 85f3556 commit 4850446
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/salesforce/src/retrieveDeltaStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export class RetrieveDeltaStrategy {
});
}

private isPackageNewer(current: Buffer | string, target: Buffer | string): boolean {
const localMeta = XML.parse(target, { arrayMode: false, ignoreAttributes: true });
const orgMeta = XML.parse(current, { arrayMode: false, ignoreAttributes: true });
private isPackageNewer(a: Buffer | string, b: Buffer | string): boolean {
const orgMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true });
const localMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true });

const localVersion = parseFloat(localMeta.InstalledPackage?.versionNumber);
const orgVersion = parseFloat(orgMeta.InstalledPackage?.versionNumber);
Expand All @@ -227,8 +227,8 @@ export class RetrieveDeltaStrategy {
private isMetaXmlEqual(a: Buffer | string, b: Buffer | string): boolean {
// Note: this function does not yet properly deal with changes in the order of XML elements in an array
// Parse XML and filter out attributes as they are not important for comparison of metadata
const localMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true });
const orgMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true });
const orgMeta = XML.parse(a, { arrayMode: false, ignoreAttributes: true });
const localMeta = XML.parse(b, { arrayMode: false, ignoreAttributes: true });

if (orgMeta.packageVersions && !localMeta.packageVersions) {
// If the org data has package versions details but the local data does not, copy the package versions details;
Expand Down

0 comments on commit 4850446

Please sign in to comment.