dist/index.esm.js
function findAndReplaceIf(target, checkFn) {
    if (!isPlainObject(target))
        return checkFn(target);
    return Object.keys(target)
        .reduce(function (carry, key) {
        var val = target[key];
        carry[key] = findAndReplaceIf(val, checkFn);
        return carry;
    }, {});
}
function findAndReplaceIf(target, checkFn) {
    if (!isPlainObject(target))
        return checkFn(target);
    return Object.keys(target)
        .reduce(function (carry, key) {
        var val = target[key];
        carry[key] = findAndReplaceIf(val, checkFn);
        return carry;
    }, {});
}
function findAndReplaceIf ( target , checkFn ) { if ( ! isPlainObject ( target ) ) return checkFn ( target ) ; return Object . keys ( target ) . reduce ( function ( carry , key ) { var val = target [ key ] ; carry [ key ] = findAndReplaceIf ( val , checkFn ) ; return carry ; } , { } ) ; }
Goes through an object recursively and replaces all props with what's is returned in the `checkFn`. Also works no non-objects.

@export
@param {*} target Target can be anything
@param {*} checkFn a function that will receive the `foundVal`
@returns {*} the target with replaced values
Goes through an object recursively and replaces all props with what s is returned in the checkFn . Also works no non - objects .