@sis-cc/dotstatsuite-components 17.32.1 → 17.32.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.
|
@@ -35,7 +35,6 @@ var hasInvalidValues = R.pipe(R.prop('values'), R.anyPass([R.isNil, R.complement
|
|
|
35
35
|
var isConceptInvalid = R.anyPass([hasInvalidValues /* add more... */]);
|
|
36
36
|
var filterValidConcepts = R.reject(isConceptInvalid);
|
|
37
37
|
// concepts is an array of ids... (misnamed!)
|
|
38
|
-
var conceptIdsLens = R.lensProp('concepts');
|
|
39
38
|
var rejectInvalidConceptIds = function rejectInvalidConceptIds() {
|
|
40
39
|
var concepts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
41
40
|
return function () {
|
|
@@ -44,7 +43,7 @@ var rejectInvalidConceptIds = function rejectInvalidConceptIds() {
|
|
|
44
43
|
var validConceptIds = R.pluck('id', filterValidConcepts(concepts));
|
|
45
44
|
return R.reduce(function (acc, comb) {
|
|
46
45
|
var refinedConcepts = R.intersection(validConceptIds, comb.concepts);
|
|
47
|
-
if (R.length(refinedConcepts) <
|
|
46
|
+
if (R.length(refinedConcepts) < 1) {
|
|
48
47
|
return acc;
|
|
49
48
|
}
|
|
50
49
|
return R.append((0, _extends4.default)({}, comb, { concepts: refinedConcepts }), acc);
|
package/package.json
CHANGED
|
@@ -18,14 +18,13 @@ const hasInvalidValues = R.pipe(
|
|
|
18
18
|
const isConceptInvalid = R.anyPass([hasInvalidValues /* add more... */]);
|
|
19
19
|
const filterValidConcepts = R.reject(isConceptInvalid);
|
|
20
20
|
// concepts is an array of ids... (misnamed!)
|
|
21
|
-
const conceptIdsLens = R.lensProp('concepts');
|
|
22
21
|
const rejectInvalidConceptIds =
|
|
23
22
|
(concepts = []) =>
|
|
24
23
|
(combinations = []) => {
|
|
25
24
|
const validConceptIds = R.pluck('id', filterValidConcepts(concepts));
|
|
26
25
|
return R.reduce((acc, comb) => {
|
|
27
26
|
const refinedConcepts = R.intersection(validConceptIds, comb.concepts);
|
|
28
|
-
if (R.length(refinedConcepts) <
|
|
27
|
+
if (R.length(refinedConcepts) < 1) {
|
|
29
28
|
return acc;
|
|
30
29
|
}
|
|
31
30
|
return R.append({ ...comb, concepts: refinedConcepts }, acc);
|
|
@@ -146,6 +146,20 @@ describe('parseCombinations tests', () => {
|
|
|
146
146
|
relationship: ['DIM4'],
|
|
147
147
|
display: true,
|
|
148
148
|
},
|
|
149
|
+
{
|
|
150
|
+
id: 'COMB11',
|
|
151
|
+
concepts: ['DIM4'],
|
|
152
|
+
relationship: ['DIM4'],
|
|
153
|
+
series: true,
|
|
154
|
+
display: true
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: 'COMB12',
|
|
158
|
+
concepts: ['DIM4'],
|
|
159
|
+
relationship: ['DIM4'],
|
|
160
|
+
series: true,
|
|
161
|
+
display: true
|
|
162
|
+
},
|
|
149
163
|
{
|
|
150
164
|
id: 'COMB14',
|
|
151
165
|
concepts: ['DIM3', 'ATTR5', 'ATTR8'],
|