• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NationalBankBelgium / stark / 9411545197

07 Jun 2024 04:15AM UTC coverage: 88.859%. Remained the same
9411545197

Pull #3814

github

web-flow
Merge c56164050 into fd511f3f4
Pull Request #3814: chore(deps): bump zone.js from 0.13.3 to 0.14.7 in /starter

1258 of 1525 branches covered (82.49%)

Branch coverage included in aggregate %.

3775 of 4139 relevant lines covered (91.21%)

193.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.18
/packages/stark-core/src/configuration/entities/metadata/application-metadata.entity.ts
1
import { ArrayNotEmpty, IsDefined, IsNotEmpty, IsString } from "class-validator";
2
import { autoserialize } from "cerialize";
3

4
import { StarkApplicationMetadata } from "./application-metadata.entity.intf";
5
import { StarkLanguageImpl } from "../language";
6
import { StarkLanguage } from "../language/language.entity.intf";
7
import { StarkLanguages } from "../language/language.constants";
8
import { StarkArrayIsValid } from "../../../validation/decorators";
9

10
/**
11
 * This class is only for serialization purposes
12
 * @ignore
13
 */
14
export class StarkApplicationMetadataImpl implements StarkApplicationMetadata {
15
        // FIXME: properties of the group "temp" are not used yet. Will they still be used?
16

17
        @IsNotEmpty({ groups: ["temp"] })
18
        @IsString({ groups: ["temp"] })
19
        @autoserialize
20
        public name!: string;
1✔
21

22
        @IsNotEmpty({ groups: ["temp"] })
23
        @IsString({ groups: ["temp"] })
24
        @autoserialize
25
        public description!: string;
1✔
26

27
        @IsNotEmpty({ groups: ["temp"] })
28
        @IsString({ groups: ["temp"] })
29
        @autoserialize
30
        public version!: string;
1✔
31

32
        @IsNotEmpty({ groups: ["temp"] })
33
        @IsString({ groups: ["temp"] })
34
        @autoserialize
35
        public environment!: string;
1✔
36

37
        @IsNotEmpty({ groups: ["temp"] })
38
        @IsString({ groups: ["temp"] })
39
        @autoserialize
40
        public buildTimestamp!: string;
1✔
41

42
        @IsNotEmpty({ groups: ["temp"] })
43
        @IsString({ groups: ["temp"] })
44
        @autoserialize
45
        public deploymentTimestamp!: string;
1✔
46

47
        @IsDefined({ groups: ["settings"] })
48
        @ArrayNotEmpty({ groups: ["settings"] })
49
        @StarkArrayIsValid({ groups: ["settings"] })
50
        public supportedLanguages: StarkLanguageImpl[] = [];
14✔
51

52
        /**
53
         * Callback method provided by cerialize in order to post-process the de-serialized json object
54
         * @param instance - Instantiated object with its properties already
55
         * set as defined via the serializer annotations
56
         * @param json - Raw json object loaded from file
57
         */
58
        public static OnDeserialized(instance: StarkApplicationMetadataImpl, json: any): void {
59
                const supportedLanguages: string[] = json["supportedLanguages"];
×
60

61
                for (const item of supportedLanguages) {
×
62
                        if (item) {
×
63
                                const languageConstant: StarkLanguage = StarkLanguages[item.toUpperCase().replace("-", "_")];
×
64
                                if (languageConstant) {
×
65
                                        instance.supportedLanguages.push(languageConstant);
×
66
                                } else {
67
                                        instance.supportedLanguages.push(new StarkLanguageImpl(item, "..."));
×
68
                                }
69
                        }
70
                }
71
        }
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc