<commit_before>var after = require('./after');

var React;
var ReactDOM;

exports.setReact = function(_React, _ReactDOM) {
  React = _React;
  ReactDOM = _ReactDOM || React;
};

var INTERACTIVE = {
  'button': true,
  'input' (props) {
    return props.type != 'hidden';
  },
  'textarea': true,
  'select': true,
  'option': true,
  'a' (props) {
    var hasHref = typeof props.href === 'string';
    var hasTabIndex = props.tabIndex != null;
    return (hasHref || !hasHref && hasTabIndex);
  }
};

const presentationRoles = ['presentation', 'none'];

var isHiddenFromAT = (props) => {
  return props['aria-hidden'] == 'true';
};

var hasAlt = (props) => {
  return typeof props.alt === 'string';
};

var isInteractive = (tagName, props) => {
  var tag = INTERACTIVE[tagName];
  return (typeof tag === 'function') ? tag(props) : tag;
};

var getComponents = (children) => {
  var childComponents = [];
  React.Children.forEach(children, function(child) {
    if (child && typeof child.type === 'function')
      childComponents.push(child);
  });
  return childComponents;
};

var hasLabel = (node) => {
  var text = node.tagName.toLowerCase() == 'img' ? node.alt : node.textContent;
  var hasTextContent = text.trim().length > 0;

  var images = node.querySelectorAll('img[alt]');
  images = Array.prototype.slice.call(images);

  var hasAltText = (images.filter((image) => {
    return image.alt.length > 0;
  }).length) > 0;

  return hasTextContent || hasAltText;
};

var assertLabel = function(node, context, failureCB) {
  if (context.passed)
    return;

  context.passed = hasLabel(node);

  if (!context.passed && context.totalChildren == (++context.childrenTested))
    failureCB();
};

var hasChildTextNode = (props, children, failureCB) => {<commit_msg>Resolve Issue 122 by not testing null results of ReactDOM.findDOMNode (#123)<commit_after>var after = require('./after');

var React;
var ReactDOM;

exports.setReact = function(_React, _ReactDOM) {
  React = _React;
  ReactDOM = _ReactDOM || React;
};

var INTERACTIVE = {
  'button': true,
  'input' (props) {
    return props.type != 'hidden';
  },
  'textarea': true,
  'select': true,
  'option': true,
  'a' (props) {
    var hasHref = typeof props.href === 'string';
    var hasTabIndex = props.tabIndex != null;
    return (hasHref || !hasHref && hasTabIndex);
  }
};

const presentationRoles = ['presentation', 'none'];

var isHiddenFromAT = (props) => {
  return props['aria-hidden'] == 'true';
};

var hasAlt = (props) => {
  return typeof props.alt === 'string';
};

var isInteractive = (tagName, props) => {
  var tag = INTERACTIVE[tagName];
  return (typeof tag === 'function') ? tag(props) : tag;
};

var getComponents = (children) => {
  var childComponents = [];
  React.Children.forEach(children, function(child) {
    if (child && typeof child.type === 'function')
      childComponents.push(child);
  });
  return childComponents;
};

var hasLabel = (node) => {
  var text = node.tagName.toLowerCase() == 'img' ? node.alt : node.textContent;
  var hasTextContent = text.trim().length > 0;

  var images = node.querySelectorAll('img[alt]');
  images = Array.prototype.slice.call(images);

  var hasAltText = (images.filter((image) => {
    return image.alt.length > 0;
  }).length) > 0;

  return hasTextContent || hasAltText;
};

var assertLabel = function(node, context, failureCB) {
  if (context.passed || node === null)
    return;

  context.passed = hasLabel(node);

  if (!context.passed && context.totalChildren == (++context.childrenTested))
    failureCB();
};

var hasChildTextNode = (props, children, failureCB) => {
{'fraction_non_alphanumeric': 0.16851134477033758, 'fraction_numerical': 0.003320420586607637, 'mean_word_length': 3.965659340659341, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '1500235', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1189, 'n_words': 290}