@zokugun/artifact 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,11 +55,20 @@ function mergeAndChains(current, incoming) {
|
|
|
55
55
|
tailResult.push(currentPart);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
58
|
+
const currentAppearsLaterInIncoming = incomingAnd
|
|
59
|
+
.slice(i + 1)
|
|
60
|
+
.some((later) => (0, prefix_of_command_1.prefixOfCommand)(later) === cPref);
|
|
61
|
+
if (currentAppearsLaterInIncoming) {
|
|
62
|
+
// Incoming inserted a step before current and shifted current to the right.
|
|
63
|
+
chainResult.push(incomingPart, currentPart);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// keep current in chain, then include incoming after
|
|
67
|
+
chainResult.push(currentPart);
|
|
68
|
+
const coveredByCurrentTail = currentTail.some((t) => t.startsWith(`${incomingPart} `));
|
|
69
|
+
if (!coveredByCurrentTail) {
|
|
70
|
+
chainResult.push(incomingPart);
|
|
71
|
+
}
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
}
|