chuvsu-js 5.5.5 → 5.5.7

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.
@@ -44,9 +44,7 @@ function sameReplacement(left, right) {
44
44
  compatibleSets(left.groups.values, right.groups.values, sameAttendance) &&
45
45
  left.teachers.values.length > 0 &&
46
46
  sameEntities(left.teachers.values, right.teachers.values) &&
47
- ((left.isDistance &&
48
- !left.rooms.values.length &&
49
- !right.rooms.values.length) ||
47
+ (left.isDistance ||
50
48
  (left.rooms.values.length > 0 &&
51
49
  sameEntities(left.rooms.values, right.rooms.values))));
52
50
  }
@@ -88,7 +88,9 @@ export function parseSubstitutionDiv(div) {
88
88
  date,
89
89
  room,
90
90
  teacher,
91
- isDistance: hasDistanceMarker(room ?? divText),
91
+ // A teacher-only replacement leaves the lesson's existing format intact.
92
+ // The portal can place the DOT marker outside the replacement room span.
93
+ isDistance: hasDistanceMarker(divText) ? true : room ? false : undefined,
92
94
  };
93
95
  }
94
96
  export function parseSubstituteForDiv(div) {
@@ -44,7 +44,7 @@ export interface Substitution {
44
44
  date: LocalDate;
45
45
  /** New room, if changed. */
46
46
  room?: string;
47
- /** Whether the substitution moves the lesson online. */
47
+ /** New distance format; absent when the substitution keeps the existing format. */
48
48
  isDistance?: boolean;
49
49
  /** New teacher, if changed. */
50
50
  teacher?: Teacher;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chuvsu-js",
3
- "version": "5.5.5",
3
+ "version": "5.5.7",
4
4
  "description": "Библиотека для расписания и личного кабинета ЧГУ им. И. Н. Ульянова",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",