Skip to content

Commit

Permalink
Add map to tell changes in sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
jalal246 committed Mar 16, 2020
1 parent 26c0004 commit 980a8e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/packageSorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
const getCoreName = require("corename");

let sorted;
let sortingMap;
let unSorted;
let coreDep;
let elemAdded;
Expand Down Expand Up @@ -64,7 +65,14 @@ function addTo(packages, at, isSorted) {
/**
* remove it from packages so it won't be checked next time.
*/
packages.splice(at, 1);
const from = packages.splice(at, 1);

if (isSorted) {
sortingMap.push({
from: from,
to: at
});
}

elemAdded += 1;
}
Expand Down

0 comments on commit 980a8e0

Please sign in to comment.