Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 466ffbf

Browse files
committed
refactor: Use indexOf in helpers
1 parent 15074da commit 466ffbf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export function isInitialOrHasNoParents(chunk) {
33
}
44

55
export function isInvalidOrder(a, b) {
6-
const bBeforeA = a.getPrevModules().includes(b);
7-
const aBeforeB = b.getPrevModules().includes(a);
6+
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
7+
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
88
return aBeforeB && bBeforeA;
99
}
1010

@@ -17,8 +17,8 @@ export function getOrder(a, b) {
1717
const bIndex = b.getOriginalModule().index2;
1818
if (aIndex < bIndex) return -1;
1919
if (aIndex > bIndex) return 1;
20-
const bBeforeA = a.getPrevModules().includes(b);
21-
const aBeforeB = b.getPrevModules().includes(a);
20+
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
21+
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
2222
if (aBeforeB && !bBeforeA) return -1;
2323
if (!aBeforeB && bBeforeA) return 1;
2424
const ai = a.identifier();

0 commit comments

Comments
 (0)