Code coverage report for object/filter.js

Statements: 100% (9 / 9)      Branches: 100% (2 / 2)      Functions: 100% (4 / 4)      Lines: 100% (8 / 8)     

All files » object/ » filter.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191           1 8 8 18 7       8   1    
define(['./forOwn'], function(forOwn) {
 
    /**
     * Creates a new object with all the properties where the callback returns
     * true.
     */
    function filterValues(obj, callback, thisObj) {
        var output = {};
        forOwn(obj, function(value, key, obj) {
            if (callback.call(thisObj, value, key, obj)) {
                output[key] = value;
            }
        });
 
        return output;
    }
    return filterValues;
});