File / Directory |
Mutation score |
# Killed |
# Survived |
# Timeout |
# No coverage |
# Runtime errors |
# Transpile errors |
Total detected |
Total undetected |
Total mutants | |
---|---|---|---|---|---|---|---|---|---|---|---|
deepmerge.js | 100.00 | 18 | 0 | 0 | 0 | 0 | 0 | 18 | 0 | 18 |
/**
* Merge literal object deeply and concat arrays
* @param {Object|Array|*} first
* @param {Object|Array|*} second
* @return {Object|Array|*}
*/
function deepmerge(first, second) 0{}{
if (1false2trueArray.isArray(first)) 3{}{
return [].concat(first).concat(second);
}
if (4false5true6first || first.constructor === Objectfirst && 7first.constructor !== Object8false9truefirst.constructor === Object) 10{}{
return Object.keys(first).reduce(
(o, key) => (11{}{
...o,
[key]: second ? deepmerge(first[key], second[key]) : first[key],
}),
12second && {}13false14truesecond || {},
);
}
return 15second && first16false17truesecond || first;
}
export default deepmerge;
# | Mutator | State | Location | Original | Replacement |
---|---|---|---|---|---|
0 | Block | Killed | 6 : 34 | {
... ;
} |
{} |
1 | IfStatement | Killed | 7 : 8 | . ( ) |
|
2 | IfStatement | Killed | 7 : 8 | . ( ) |
|
3 | Block | Killed | 7 : 30 | {
... } |
{} |
4 | IfStatement | Killed | 11 : 8 | && ... === |
|
5 | IfStatement | Killed | 11 : 8 | && ... === |
|
6 | BinaryExpression | Killed | 11 : 8 | && ... === |
|| ... === |
7 | BinaryExpression | Killed | 11 : 17 | . ... === |
. ... !== |
8 | ConditionalExpression | Killed | 11 : 17 | . ... === |
|
9 | ConditionalExpression | Killed | 11 : 17 | . ... === |
|
10 | Block | Killed | 11 : 47 | {
... } |
{} |
11 | ObjectLiteral | Killed | 13 : 25 | {
... } |
{} |
12 | BinaryExpression | Killed | 17 : 12 | || {} |
&& {} |
13 | ConditionalExpression | Killed | 17 : 12 | || {} |
|
14 | ConditionalExpression | Killed | 17 : 12 | || {} |
|
15 | BinaryExpression | Killed | 21 : 11 | || |
&& |
16 | ConditionalExpression | Killed | 21 : 11 | || |
|
17 | ConditionalExpression | Killed | 21 : 11 | || |
|