@openframe-org/criteria-set-protocol 1.4.7 → 1.4.8
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/dist/v1/utils.js +11 -22
- package/package.json +1 -1
package/dist/v1/utils.js
CHANGED
|
@@ -51,31 +51,20 @@ exports.resolveCode = resolveCode;
|
|
|
51
51
|
* Find an element in the criteria tree by its code
|
|
52
52
|
*/
|
|
53
53
|
const findInTree = (tree, code) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (const criteria of quality.items) {
|
|
59
|
-
if (criteria.code === code) {
|
|
60
|
-
return criteria;
|
|
54
|
+
const searchElements = (elements) => {
|
|
55
|
+
for (const element of elements) {
|
|
56
|
+
if (element.code == code) {
|
|
57
|
+
return element;
|
|
61
58
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
for (const task of taskGroup.items) {
|
|
67
|
-
if (task.code === code) {
|
|
68
|
-
return task;
|
|
69
|
-
}
|
|
70
|
-
for (const taskItem of task.items) {
|
|
71
|
-
if (taskItem.code === code) {
|
|
72
|
-
return taskItem;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
59
|
+
if (!(0, exports.isTaskItem)(element)) {
|
|
60
|
+
const foundElement = searchElements(element.items);
|
|
61
|
+
if (foundElement != null) {
|
|
62
|
+
return foundElement;
|
|
75
63
|
}
|
|
76
64
|
}
|
|
77
65
|
}
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
return searchElements(tree.qualities);
|
|
80
69
|
};
|
|
81
70
|
exports.findInTree = findInTree;
|
package/package.json
CHANGED