lib/filter.js
function _filterByArraySchema(data, schema) {
    return Object
        .keys(data)
        .filter(function (key) {
            return !!~schema.indexOf(key);
        })
        .reduce(function (memo, key) {
            memo[key] = data[key];
            return memo;
        }, {});
}
function _filterByArraySchema(data, schema) {
    return Object
        .keys(data)
        .filter(function (key) {
            return !!~schema.indexOf(key);
        })
        .reduce(function (memo, key) {
            memo[key] = data[key];
            return memo;
        }, {});
}
function _filterByArraySchema ( data , schema ) { return Object . keys ( data ) . filter ( function ( key ) { return ! ! ~ schema . indexOf ( key ) ; } ) . reduce ( function ( memo , key ) { memo [ key ] = data [ key ] ; return memo ; } , { } ) ; }
Filters an object from an array schema
@param data Object to filter
@param schema Fields to keep
@returns {*}
@private
Filters an object from an array schema