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

typeorm / typeorm / 15219332477

23 May 2025 09:13PM UTC coverage: 17.216% (-59.1%) from 76.346%
15219332477

Pull #11332

github

naorpeled
cr comments - move if block
Pull Request #11332: feat: add new undefined and null behavior flags

1603 of 12759 branches covered (12.56%)

Branch coverage included in aggregate %.

0 of 31 new or added lines in 3 files covered. (0.0%)

14132 existing lines in 166 files now uncovered.

4731 of 24033 relevant lines covered (19.69%)

60.22 hits per line

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

9.09
/src/metadata/ExclusionMetadata.ts
1
import { EntityMetadata } from "./EntityMetadata"
2
import { NamingStrategyInterface } from "../naming-strategy/NamingStrategyInterface"
3
import { ExclusionMetadataArgs } from "../metadata-args/ExclusionMetadataArgs"
4

5
/**
6
 * Exclusion metadata contains all information about table's exclusion constraints.
7
 */
8
export class ExclusionMetadata {
1✔
9
    // ---------------------------------------------------------------------
10
    // Public Properties
11
    // ---------------------------------------------------------------------
12

13
    /**
14
     * Entity metadata of the class to which this exclusion constraint is applied.
15
     */
16
    entityMetadata: EntityMetadata
17

18
    /**
19
     * Target class to which metadata is applied.
20
     */
21
    target?: Function | string
22

23
    /**
24
     * Exclusion expression.
25
     */
26
    expression: string
27

28
    /**
29
     * User specified exclusion constraint name.
30
     */
31
    givenName?: string
32

33
    /**
34
     * Final exclusion constraint name.
35
     * If exclusion constraint name was given by a user then it stores normalized (by naming strategy) givenName.
36
     * If exclusion constraint name was not given then its generated.
37
     */
38
    name: string
39

40
    // ---------------------------------------------------------------------
41
    // Constructor
42
    // ---------------------------------------------------------------------
43

44
    constructor(options: {
45
        entityMetadata: EntityMetadata
46
        args?: ExclusionMetadataArgs
47
    }) {
UNCOV
48
        this.entityMetadata = options.entityMetadata
×
49

UNCOV
50
        if (options.args) {
×
UNCOV
51
            this.target = options.args.target
×
UNCOV
52
            this.expression = options.args.expression
×
UNCOV
53
            this.givenName = options.args.name
×
54
        }
55
    }
56

57
    // ---------------------------------------------------------------------
58
    // Public Build Methods
59
    // ---------------------------------------------------------------------
60

61
    /**
62
     * Builds some depend exclusion constraint properties.
63
     * Must be called after all entity metadata's properties map, columns and relations are built.
64
     */
65
    build(namingStrategy: NamingStrategyInterface): this {
UNCOV
66
        this.name = this.givenName
×
67
            ? this.givenName
68
            : namingStrategy.exclusionConstraintName(
69
                  this.entityMetadata.tableName,
70
                  this.expression,
71
              )
UNCOV
72
        return this
×
73
    }
74
}
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