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

typeorm / typeorm / 15089093306

17 May 2025 09:03PM UTC coverage: 50.109% (-26.2%) from 76.346%
15089093306

Pull #11437

github

naorpeled
add comment about vector <#>
Pull Request #11437: feat(postgres): support vector data type

5836 of 12767 branches covered (45.71%)

Branch coverage included in aggregate %.

16 of 17 new or added lines in 4 files covered. (94.12%)

6283 existing lines in 64 files now uncovered.

12600 of 24025 relevant lines covered (52.45%)

28708.0 hits per line

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

97.62
/src/util/InstanceChecker.ts
1
import type { MongoEntityManager } from "../entity-manager/MongoEntityManager"
2
import type { SqljsEntityManager } from "../entity-manager/SqljsEntityManager"
3
import type { EntitySchema } from "../entity-schema/EntitySchema"
4
import type { FindOperator } from "../find-options/FindOperator"
5
import type { EqualOperator } from "../find-options/EqualOperator"
6
import type { Query } from "../driver/Query"
7
import type { RdbmsSchemaBuilder } from "../schema-builder/RdbmsSchemaBuilder"
8
import type { Subject } from "../persistence/Subject"
9
import type { SelectQueryBuilder } from "../query-builder/SelectQueryBuilder"
10
import type { UpdateQueryBuilder } from "../query-builder/UpdateQueryBuilder"
11
import type { DeleteQueryBuilder } from "../query-builder/DeleteQueryBuilder"
12
import type { SoftDeleteQueryBuilder } from "../query-builder/SoftDeleteQueryBuilder"
13
import type { InsertQueryBuilder } from "../query-builder/InsertQueryBuilder"
14
import type { RelationQueryBuilder } from "../query-builder/RelationQueryBuilder"
15
import type { Brackets } from "../query-builder/Brackets"
16
import type { Table } from "../schema-builder/table/Table"
17
import type { TableCheck } from "../schema-builder/table/TableCheck"
18
import type { TableColumn } from "../schema-builder/table/TableColumn"
19
import type { TableExclusion } from "../schema-builder/table/TableExclusion"
20
import type { TableForeignKey } from "../schema-builder/table/TableForeignKey"
21
import type { TableIndex } from "../schema-builder/table/TableIndex"
22
import type { TableUnique } from "../schema-builder/table/TableUnique"
23
import type { View } from "../schema-builder/view/View"
24
import type { NotBrackets } from "../query-builder/NotBrackets"
25
import type { EntityMetadata } from "../metadata/EntityMetadata"
26
import type { ColumnMetadata } from "../metadata/ColumnMetadata"
27
import type { MssqlParameter } from "../driver/sqlserver/MssqlParameter"
28
import { DataSource } from "../data-source"
29
import { BaseEntity } from "../repository/BaseEntity"
30

31
export class InstanceChecker {
54✔
32
    static isMssqlParameter(obj: unknown): obj is MssqlParameter {
UNCOV
33
        return this.check(obj, "MssqlParameter")
×
34
    }
35
    static isEntityMetadata(obj: unknown): obj is EntityMetadata {
36
        return this.check(obj, "EntityMetadata")
1,909,352✔
37
    }
38
    static isColumnMetadata(obj: unknown): obj is ColumnMetadata {
39
        return this.check(obj, "ColumnMetadata")
126,040✔
40
    }
41
    static isSelectQueryBuilder(obj: unknown): obj is SelectQueryBuilder<any> {
42
        return this.check(obj, "SelectQueryBuilder")
72✔
43
    }
44
    static isInsertQueryBuilder(obj: unknown): obj is InsertQueryBuilder<any> {
45
        return this.check(obj, "InsertQueryBuilder")
51,700✔
46
    }
47
    static isDeleteQueryBuilder(obj: unknown): obj is DeleteQueryBuilder<any> {
48
        return this.check(obj, "DeleteQueryBuilder")
801✔
49
    }
50
    static isUpdateQueryBuilder(obj: unknown): obj is UpdateQueryBuilder<any> {
51
        return this.check(obj, "UpdateQueryBuilder")
3,772✔
52
    }
53
    static isSoftDeleteQueryBuilder(
54
        obj: unknown,
55
    ): obj is SoftDeleteQueryBuilder<any> {
56
        return this.check(obj, "SoftDeleteQueryBuilder")
240✔
57
    }
58
    static isRelationQueryBuilder(
59
        obj: unknown,
60
    ): obj is RelationQueryBuilder<any> {
61
        return this.check(obj, "RelationQueryBuilder")
415✔
62
    }
63
    static isBrackets(obj: unknown): obj is Brackets {
64
        return this.check(obj, "Brackets") || this.check(obj, "NotBrackets")
42,133✔
65
    }
66
    static isNotBrackets(obj: unknown): obj is NotBrackets {
67
        return this.check(obj, "NotBrackets")
7,939✔
68
    }
69
    static isSubject(obj: unknown): obj is Subject {
70
        return this.check(obj, "Subject")
324,966✔
71
    }
72
    static isRdbmsSchemaBuilder(obj: unknown): obj is RdbmsSchemaBuilder {
73
        return this.check(obj, "RdbmsSchemaBuilder")
62✔
74
    }
75
    static isMongoEntityManager(obj: unknown): obj is MongoEntityManager {
76
        return this.check(obj, "MongoEntityManager")
326,083✔
77
    }
78
    static isSqljsEntityManager(obj: unknown): obj is SqljsEntityManager {
79
        return this.check(obj, "SqljsEntityManager")
10✔
80
    }
81
    static isEntitySchema(obj: unknown): obj is EntitySchema {
82
        return this.check(obj, "EntitySchema")
164,310✔
83
    }
84
    static isBaseEntityConstructor(obj: unknown): obj is typeof BaseEntity {
85
        return (
7,382✔
86
            typeof obj === "function" &&
14,364✔
87
            typeof (obj as typeof BaseEntity).hasId === "function" &&
88
            typeof (obj as typeof BaseEntity).save === "function" &&
89
            typeof (obj as typeof BaseEntity).useDataSource === "function"
90
        )
91
    }
92
    static isFindOperator(obj: unknown): obj is FindOperator<any> {
93
        return (
186,528✔
94
            this.check(obj, "FindOperator") || this.check(obj, "EqualOperator")
324,313✔
95
        )
96
    }
97
    static isEqualOperator(obj: unknown): obj is EqualOperator<any> {
98
        return this.check(obj, "EqualOperator")
14,244✔
99
    }
100
    static isQuery(obj: unknown): obj is Query {
101
        return this.check(obj, "Query")
79,746✔
102
    }
103
    static isTable(obj: unknown): obj is Table {
104
        return this.check(obj, "Table")
3,116,057✔
105
    }
106
    static isTableCheck(obj: unknown): obj is TableCheck {
107
        return this.check(obj, "TableCheck")
18✔
108
    }
109
    static isTableColumn(obj: unknown): obj is TableColumn {
110
        return this.check(obj, "TableColumn")
1,870✔
111
    }
112
    static isTableExclusion(obj: unknown): obj is TableExclusion {
113
        return this.check(obj, "TableExclusion")
10✔
114
    }
115
    static isTableForeignKey(obj: unknown): obj is TableForeignKey {
116
        return this.check(obj, "TableForeignKey")
1,918,044✔
117
    }
118
    static isTableIndex(obj: unknown): obj is TableIndex {
119
        return this.check(obj, "TableIndex")
26,384✔
120
    }
121
    static isTableUnique(obj: unknown): obj is TableUnique {
122
        return this.check(obj, "TableUnique")
24✔
123
    }
124
    static isView(obj: unknown): obj is View {
125
        return this.check(obj, "View")
2,104,094✔
126
    }
127
    static isDataSource(obj: unknown): obj is DataSource {
128
        return this.check(obj, "DataSource")
239,686✔
129
    }
130

131
    private static check(obj: unknown, name: string) {
132
        return (
10,816,583✔
133
            typeof obj === "object" &&
22,923,991✔
134
            obj !== null &&
135
            (obj as { "@instanceof": symbol })["@instanceof"] ===
136
                Symbol.for(name)
137
        )
138
    }
139
}
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