<commit_before>var React = require('react');
var Link = require('react-router').Link;
var Results = require('../data.json');
var HomeCard = require('./homecard.js').HomeCard;
var $ = require('jquery');

var SearchResults = React.createClass({
 
  filterResults: function(searchCrit) {
    var filtered = Results.filter(function(estate) {
      if (1 + $.inArray(estate.type, searchCrit.estateType) ) {
        return true;
      } else {
        return false;
      }
    }).filter(function(estate) {
        if (searchCrit.price.min === '' ||
            (estate.price !== undefined && estate.price !== '' && estate.price >= searchCrit.price.min)) {
          return true;
        } else {
          return false;
        }
      })
      .filter(function(estate) {
        if (searchCrit.price.max === '' ||
            (estate.price !== undefined && estate.price !== '' && estate.price <= searchCrit.price.max)) {
          return true;
        } else {
          return false;
        }
      })
      .filter(function(estate) {
        if (searchCrit.roomNbr.min === '' ||
            (estate.properties.bedrooms !== undefined && estate.properties.bedrooms !== '' && estate.properties.bedrooms >= searchCrit.roomNbr.min)) {
          return true;
        } else {
          return false;
        }<commit_msg>filter fix no type selected<commit_after>var React = require('react');
var Link = require('react-router').Link;
var Results = require('../data.json');
var HomeCard = require('./homecard.js').HomeCard;
var $ = require('jquery');

var SearchResults = React.createClass({
 
  filterResults: function(searchCrit) {
    var filtered = Results.filter(function(estate) {
      if (searchCrit.estateType.length == 0 || 1 + $.inArray(estate.type, searchCrit.estateType) ) {
        return true;
      } else {
        return false;
      }
    }).filter(function(estate) {
        if (searchCrit.price.min === '' ||
            (estate.price !== undefined && estate.price !== '' && estate.price >= searchCrit.price.min)) {
          return true;
        } else {
          return false;
        }
      })
      .filter(function(estate) {
        if (searchCrit.price.max === '' ||
            (estate.price !== undefined && estate.price !== '' && estate.price <= searchCrit.price.max)) {
          return true;
        } else {
          return false;
        }
      })
      .filter(function(estate) {
        if (searchCrit.roomNbr.min === '' ||
            (estate.properties.bedrooms !== undefined && estate.properties.bedrooms !== '' && estate.properties.bedrooms >= searchCrit.roomNbr.min)) {
          return true;
        } else {
          return false;
        }
{'fraction_non_alphanumeric': 0.1605076521089959, 'fraction_numerical': 0.0011198208286674132, 'mean_word_length': 2.2250300842358604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879149', 'n_tokens_mistral': 777, 'n_tokens_neox': 752, 'n_words': 146}