@royalschedule/maps 3.0.9 → 3.0.11
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.
|
@@ -9,14 +9,14 @@ function deconstructGroups(groups, participantIds, destructMap, options) {
|
|
|
9
9
|
var idKey = options.idKey || 'id';
|
|
10
10
|
if (destructMap.size) {
|
|
11
11
|
groups.forEach(group => {
|
|
12
|
-
var _group$to
|
|
13
|
-
var id = (_group$to
|
|
12
|
+
var _group$to;
|
|
13
|
+
var id = (_group$to = group.to) === null || _group$to === void 0 || (_group$to = _group$to[idKey]) === null || _group$to === void 0 ? void 0 : _group$to.toString();
|
|
14
14
|
if (!id) return;
|
|
15
15
|
var destructed = destructMap.get(id);
|
|
16
16
|
if (!destructed) return;
|
|
17
17
|
var remaining = Array.from(destructed).filter(pId => {
|
|
18
18
|
var _group$exclude;
|
|
19
|
-
return !((_group$exclude = group.exclude) !== null && _group$exclude !== void 0 && _group$exclude.some(x => x[idKey] == pId));
|
|
19
|
+
return !((_group$exclude = group.exclude) !== null && _group$exclude !== void 0 && _group$exclude.some(x => (x === null || x === void 0 ? void 0 : x[idKey]) == pId));
|
|
20
20
|
}).map(x => "persons.".concat(x));
|
|
21
21
|
participantIds.push(...remaining.filter(x => !participantIds.includes(x)));
|
|
22
22
|
});
|
|
@@ -32,20 +32,20 @@ function mapGroupReferences(source, options, destructMap) {
|
|
|
32
32
|
var {
|
|
33
33
|
to
|
|
34
34
|
} = _ref4;
|
|
35
|
-
return to[idKey];
|
|
35
|
+
return to === null || to === void 0 ? void 0 : to[idKey];
|
|
36
36
|
}).filter(x => !!x).map(x => 'teachers.' + x.toString());
|
|
37
37
|
var groupIds = groups.map(_ref5 => {
|
|
38
38
|
var _to$parentGroups;
|
|
39
39
|
var {
|
|
40
40
|
to
|
|
41
41
|
} = _ref5;
|
|
42
|
-
return (_to$parentGroups = to.parentGroups) !== null && _to$parentGroups !== void 0 && _to$parentGroups.length ? to.parentGroups.map(x => x[idKey]) : to[idKey];
|
|
42
|
+
return to !== null && to !== void 0 && (_to$parentGroups = to.parentGroups) !== null && _to$parentGroups !== void 0 && _to$parentGroups.length ? to.parentGroups.map(x => x === null || x === void 0 ? void 0 : x[idKey]).filter(Boolean) : to === null || to === void 0 ? void 0 : to[idKey];
|
|
43
43
|
}).flat().filter(x => !!x).map(x => 'groups.' + x.toString());
|
|
44
44
|
var participantIds = participants.map(_ref6 => {
|
|
45
45
|
var {
|
|
46
46
|
to
|
|
47
47
|
} = _ref6;
|
|
48
|
-
return to[idKey];
|
|
48
|
+
return to === null || to === void 0 ? void 0 : to[idKey];
|
|
49
49
|
}).filter(x => !!x).map(x => 'persons.' + x.toString());
|
|
50
50
|
deconstructGroups(groups, participantIds, destructMap, options);
|
|
51
51
|
var out = [...new Set(teacherIds), ...new Set(groupIds), ...new Set(participantIds)].map(x => [x]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","names":["deconstructGroups","groups","participantIds","destructMap","options","idKey","size","forEach","group","_group$to
|
|
1
|
+
{"version":3,"file":"groups.js","names":["deconstructGroups","groups","participantIds","destructMap","options","idKey","size","forEach","group","_group$to","id","to","toString","destructed","get","remaining","Array","from","filter","pId","_group$exclude","exclude","some","x","map","concat","push","includes","mapGroupReferences","source","_ref","_source$teachers","_source$course","_ref2","_source$groups","_source$course2","_ref3","_source$participants","_source$course3","teachers","course","participants","teacherIds","_ref4","groupIds","_ref5","_to$parentGroups","parentGroups","length","Boolean","flat","_ref6","out","Set"],"sources":["../../../../../src/RS/v2/to/course-events/groups.ts"],"sourcesContent":[null],"mappings":";;;;;;;AAQM,SAAUA,iBAAiBA,CAC/BC,MAAoE,EACpEC,cAAwB,EACxBC,WAA+C,EAC/CC,OAA0B;EAE1B,IAAMC,KAAK,GAAGD,OAAO,CAACC,KAAK,IAAI,IAAI;EAEnC,IAAIF,WAAW,CAACG,IAAI,EAAE;IACpBL,MAAM,CAACM,OAAO,CAACC,KAAK,IAAG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