lib/filter.js
function resolveSchemaDeps(result, schema, schemasMap) {
  if (! (schema.deps || []).length) return result.concat([ schema ]);

  return schema.deps.reduce(function (result, tableName) {
    return (result.indexOf(schemasMap[tableName]) >= 0) ?
           result :
           result.concat(resolveSchemaDeps(result, schemasMap[tableName], schemasMap));
  }, result).concat([ schema ]);
}
function resolveSchemaDeps(result, schema, schemasMap) {
  if (! (schema.deps || []).length) return result.concat([ schema ]);

  return schema.deps.reduce(function (result, tableName) {
    return (result.indexOf(schemasMap[tableName]) >= 0) ?
           result :
           result.concat(resolveSchemaDeps(result, schemasMap[tableName], schemasMap));
  }, result).concat([ schema ]);
}
function resolveSchemaDeps ( result , schema , schemasMap ) { if ( ! ( schema . deps || [ ] ) . length ) return result . concat ( [ schema ] ) ; return schema . deps . reduce ( function ( result , tableName ) { return ( result . indexOf ( schemasMap [ tableName ] ) >= 0 ) ? result : result . concat ( resolveSchemaDeps ( result , schemasMap [ tableName ] , schemasMap ) ) ; } , result ) . concat ( [ schema ] ) ; }
Resolve provided schema dependencies.

@param {[Schema]} result
@param {Schema} schema
@param {Object} schemasMap
@return {[String]} - table names
Resolve provided schema dependencies .