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

typeorm / typeorm / 19549987525

20 Nov 2025 08:11PM UTC coverage: 80.769% (+4.3%) from 76.433%
19549987525

push

github

web-flow
ci: run tests on commits to master and next (#11783)

Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>

26500 of 32174 branches covered (82.36%)

Branch coverage included in aggregate %.

91252 of 113615 relevant lines covered (80.32%)

88980.79 hits per line

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

95.88
/src/util/ObjectUtils.ts
1
import { MixedList } from "../common/MixedList"
26✔
2

26✔
3
export class ObjectUtils {
26✔
4
    /**
26✔
5
     * Checks if given value is an object.
26✔
6
     * We cannot use instanceof because it has problems when running on different contexts.
26✔
7
     * And we don't simply use typeof because typeof null === "object".
26✔
8
     */
26✔
9
    static isObject(val: any): val is object {
26✔
10
        return val !== null && typeof val === "object"
1,761,230✔
11
    }
1,761,230✔
12

26✔
13
    /**
26✔
14
     * Checks if given value is an object.
26✔
15
     * We cannot use instanceof because it has problems when running on different contexts.
26✔
16
     * And we don't simply use typeof because typeof null === "object".
26✔
17
     */
26✔
18
    static isObjectWithName(val: any): val is object & { name: string } {
26✔
19
        return (
187,135✔
20
            val !== null && typeof val === "object" && val["name"] !== undefined
187,135✔
21
        )
187,135✔
22
    }
187,135✔
23

26✔
24
    /**
26✔
25
     * Copy the values of all of the enumerable own properties from one or more source objects to a
26✔
26
     * target object.
26✔
27
     * @param target The target object to copy to.
26✔
28
     * @param source The source object from which to copy properties.
26✔
29
     */
26✔
30
    static assign<T, U>(target: T, source: U): void
26✔
31

26✔
32
    /**
26✔
33
     * Copy the values of all of the enumerable own properties from one or more source objects to a
26✔
34
     * target object.
26✔
35
     * @param target The target object to copy to.
26✔
36
     * @param source1 The first source object from which to copy properties.
26✔
37
     * @param source2 The second source object from which to copy properties.
26✔
38
     */
26✔
39
    static assign<T, U, V>(target: T, source1: U, source2: V): void
26✔
40

26✔
41
    /**
26✔
42
     * Copy the values of all of the enumerable own properties from one or more source objects to a
26✔
43
     * target object.
26✔
44
     * @param target The target object to copy to.
26✔
45
     * @param source1 The first source object from which to copy properties.
26✔
46
     * @param source2 The second source object from which to copy properties.
26✔
47
     * @param source3 The third source object from which to copy properties.
26✔
48
     */
26✔
49
    static assign<T, U, V, W>(
26✔
50
        target: T,
26✔
51
        source1: U,
26✔
52
        source2: V,
26✔
53
        source3: W,
26✔
54
    ): void
26✔
55

26✔
56
    /**
26✔
57
     * Copy the values of all of the enumerable own properties from one or more source objects to a
26✔
58
     * target object.
26✔
59
     * @param target The target object to copy to.
26✔
60
     * @param sources One or more source objects from which to copy properties
26✔
61
     */
26✔
62
    static assign(target: object, ...sources: any[]): void {
26✔
63
        for (const source of sources) {
5,682,375✔
64
            for (const prop of Object.getOwnPropertyNames(source)) {
5,682,375✔
65
                ;(target as any)[prop] = source[prop]
933,422✔
66
            }
933,422✔
67
        }
5,682,375✔
68
    }
5,682,375✔
69

26✔
70
    /**
26✔
71
     * Converts MixedList<T> to strictly an array of its T items.
26✔
72
     */
26✔
73
    static mixedListToArray<T>(list: MixedList<T>): T[] {
26✔
74
        if (list !== null && typeof list === "object") {
43,177✔
75
            return Object.keys(list).map(
43,177✔
76
                (key) => (list as { [key: string]: T })[key],
43,177✔
77
            )
43,177✔
78
        } else {
43,177!
79
            return list
×
80
        }
×
81
    }
43,177✔
82
}
26✔
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

© 2026 Coveralls, Inc