@quesmed/types 1.3.2 → 1.3.3
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/utils/lightgallery.d.ts +3 -2
- package/utils/lightgallery.js +41 -19
package/package.json
CHANGED
package/utils/lightgallery.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { IOsceMarksheet } from '../models';
|
|
1
|
+
import { IOsceMarksheet, IOsceStation } from '../models';
|
|
2
2
|
export interface ILightGalleryCache {
|
|
3
3
|
CacheManager: any;
|
|
4
4
|
Platform: any;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare function lightgalleryOsceResolve(data: IOsceStation, cache?: ILightGalleryCache): Promise<IOsceStation>;
|
|
7
|
+
export declare function lightgalleryOsceResolve(data: IOsceMarksheet, cache?: ILightGalleryCache): Promise<IOsceMarksheet>;
|
package/utils/lightgallery.js
CHANGED
|
@@ -11,25 +11,47 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.lightgalleryOsceResolve = void 0;
|
|
13
13
|
const lightgalleryRegex = /\[lightgallery\]/;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
function isOsceMarksheet(data) {
|
|
15
|
+
return 'osceStationId' in data;
|
|
16
|
+
}
|
|
17
|
+
function lightgalleryOsceResolve(data, cache) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
let station;
|
|
20
|
+
if (isOsceMarksheet(data)) {
|
|
21
|
+
if (!data.osceStation) {
|
|
22
|
+
throw new Error('OsceStation not found on OsceMarksheet');
|
|
23
|
+
}
|
|
24
|
+
station = data.osceStation;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
station = data;
|
|
28
|
+
}
|
|
29
|
+
const upOsceStation = {
|
|
30
|
+
candidateBrief: station.candidateBrief,
|
|
31
|
+
actorBrief: station.actorBrief,
|
|
32
|
+
examinerBrief: station.examinerBrief,
|
|
33
|
+
explanation: station.explanation,
|
|
34
|
+
};
|
|
35
|
+
if (station.candidatePictures && station.candidatePictures.length > 0) {
|
|
36
|
+
upOsceStation.candidateBrief = yield lightgalleryMutation(upOsceStation.candidateBrief, station.candidatePictures, cache);
|
|
37
|
+
}
|
|
38
|
+
if (station.actorPictures && station.actorPictures.length > 0) {
|
|
39
|
+
upOsceStation.actorBrief = yield lightgalleryMutation(upOsceStation.actorBrief, station.actorPictures, cache);
|
|
40
|
+
}
|
|
41
|
+
if (station.examinerPictures && station.examinerPictures.length > 0) {
|
|
42
|
+
upOsceStation.examinerBrief = yield lightgalleryMutation(upOsceStation.examinerBrief, station.examinerPictures, cache);
|
|
43
|
+
}
|
|
44
|
+
if (station.walkthroughPictures && station.walkthroughPictures.length > 0) {
|
|
45
|
+
upOsceStation.explanation = yield lightgalleryMutation(upOsceStation.explanation, station.walkthroughPictures, cache);
|
|
46
|
+
}
|
|
47
|
+
if (isOsceMarksheet(data)) {
|
|
48
|
+
return Object.assign(Object.assign({}, data), { osceStation: Object.assign(Object.assign({}, data.osceStation), upOsceStation) });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return Object.assign(Object.assign({}, data), upOsceStation);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
33
55
|
exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
|
|
34
56
|
const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
57
|
var _a;
|