<commit_before>import Ember from 'ember-metal/core';
import merge from 'ember-metal/merge';
import { get } from 'ember-metal/property_get';
import { isArray } from 'ember-runtime/utils';
import Stream from 'ember-metal/streams/stream';
import { read, isStream } from 'ember-metal/streams/utils';

export default function shouldDisplay(predicate) {
  if (isStream(predicate)) {
    return new ShouldDisplayStream(predicate);
  }

  var type = typeof predicate;

  if (type === 'boolean') { return predicate; }

  if (type && type === 'object') {
    var isTruthy = get(predicate, 'isTruthy');
    if (typeof isTruthy === 'boolean') {
      return isTruthy;
    }
  }
<commit_msg>[CLEANUP beta] Add test that predicate is not null in streams#shouldDisplay<commit_after>import Ember from 'ember-metal/core';
import merge from 'ember-metal/merge';
import { get } from 'ember-metal/property_get';
import { isArray } from 'ember-runtime/utils';
import Stream from 'ember-metal/streams/stream';
import { read, isStream } from 'ember-metal/streams/utils';

export default function shouldDisplay(predicate) {
  if (isStream(predicate)) {
    return new ShouldDisplayStream(predicate);
  }

  var type = typeof predicate;

  if (type === 'boolean') { return predicate; }

  if (type && type === 'object' && predicate !== null) {
    var isTruthy = get(predicate, 'isTruthy');
    if (typeof isTruthy === 'boolean') {
      return isTruthy;
    }
  }

{'fraction_non_alphanumeric': 0.1361111111111111, 'fraction_numerical': 0.0, 'mean_word_length': 4.24, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3515311', 'n_tokens_mistral': 467, 'n_tokens_neox': 443, 'n_words': 126}