push
github
301 of 301 branches covered (100.0%)
Branch coverage included in aggregate %.
18 of 21 new or added lines in 2 files covered. (85.71%)
11 existing lines in 1 file now uncovered.1330 of 1344 relevant lines covered (98.96%)
103.52 hits per line
| 1 |
'use strict'; |
|
| 2 |
|
|
| 3 |
import {
|
1✔ |
| 4 |
getProps, |
|
| 5 |
Props |
|
| 6 |
} from '../api/types/Props'; |
|
| 7 |
|
|
| 8 |
export const sibling = (instance: object): unknown => { |
1✔ |
| 9 |
|
|
|
UNCOV
10
|
const siblings = (SiblingTypeName: string) => { |
× |
|
UNCOV
11
|
const props = getProps(instance) as Props;
|
× |
|
UNCOV
12
|
const { __collection__: collection, } = props; |
× |
|
UNCOV
13
|
const answer = collection[ SiblingTypeName ];
|
× |
|
UNCOV
14
|
return answer;
|
× |
| 15 |
}; |
|
| 16 |
|
|
|
UNCOV
17
|
const result = new Proxy( |
× |
| 18 |
siblings, |
|
| 19 |
{
|
|
| 20 |
get (_, prop: string) {
|
|
|
UNCOV
21
|
const proxyResult = siblings(prop);
|
× |
|
UNCOV
22
|
return proxyResult;
|
× |
| 23 |
}, |
|
| 24 |
apply (_, __, args,) {
|
|
|
UNCOV
25
|
const proxyResult = siblings(args[ 0 ]); |
× |
|
UNCOV
26
|
return proxyResult;
|
× |
| 27 |
} |
|
| 28 |
} |
|
| 29 |
); |
|
| 30 |
|
|
|
UNCOV
31
|
return result;
|
× |
| 32 |
|
|
| 33 |
}; |