Stryker

deepmerge.js - Stryker report

File / Directory
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Runtime errors
# Transpile errors
Total detected
Total undetected
Total mutants
deepmerge.js
100.00 %
100.00 18 0 0 0 0 0 18 0 18
Expand all
/**
 * Merge literal object deeply and concat arrays
 * @param {Object|Array|*} first
 * @param {Object|Array|*} second
 * @return {Object|Array|*}
 */
function deepmerge(first, second) 0{
    if (12Array.isArray(first)) 3{
        return [].concat(first).concat(second);
    }

    if (456first && 789first.constructor === Object) 10{
        return Object.keys(first).reduce(
            (o, key) => (11{
                ...o,
                [key]: second ? deepmerge(first[key], second[key]) : first[key],
            }),
            121314second || {},
        );
    }

    return 151617second || 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 ||