testilo 47.1.2 → 48.0.0
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.
- package/package.json +1 -1
- package/procs/excerpts/excerpts.js +9 -12
package/package.json
CHANGED
|
@@ -62,8 +62,10 @@ exports.collateExcerpts = report => {
|
|
|
62
62
|
if (pathID) {
|
|
63
63
|
// Add the excerpt to the excerpt directory unless one already exists.
|
|
64
64
|
excerpts[pathID][which] ??= excerpt;
|
|
65
|
-
// Add the text to the text directory unless one already exists.
|
|
66
|
-
|
|
65
|
+
// Add the text, if non-empty, to the text directory unless one already exists.
|
|
66
|
+
if (text.length) {
|
|
67
|
+
texts[pathID][which] ??= text;
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
71
|
}
|
|
@@ -72,15 +74,8 @@ exports.collateExcerpts = report => {
|
|
|
72
74
|
if (Object.keys(texts).length) {
|
|
73
75
|
// For each path ID in it:
|
|
74
76
|
Object.keys(texts).forEach(pathID => {
|
|
75
|
-
|
|
76
|
-
//
|
|
77
|
-
toolNames.forEach(toolName => {
|
|
78
|
-
if (! texts[pathID][toolName]) {
|
|
79
|
-
delete texts[pathID][toolName];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
toolNames = Object.keys(texts[pathID]);
|
|
83
|
-
// If the element has only 1 remaining text:
|
|
77
|
+
const toolNames = Object.keys(texts[pathID]);
|
|
78
|
+
// If the element has only 1 text:
|
|
84
79
|
if (toolNames.length === 1) {
|
|
85
80
|
// Change its key to unanimous.
|
|
86
81
|
texts[pathID].unanimous = texts[pathID][toolNames[0]];
|
|
@@ -93,7 +88,9 @@ exports.collateExcerpts = report => {
|
|
|
93
88
|
Object
|
|
94
89
|
.values(texts[pathID])
|
|
95
90
|
.slice(1)
|
|
96
|
-
.every(
|
|
91
|
+
.every(
|
|
92
|
+
text => text.every((value, index) => value === texts[pathID][toolNames[0]][index])
|
|
93
|
+
)
|
|
97
94
|
) {
|
|
98
95
|
// Consolidate the texts to 1 unanimous text.
|
|
99
96
|
texts[pathID].unanimous = texts[pathID][toolNames[0]];
|