node_modules/eslint-plugin-compat/lib/providers/CanIUseProvider.js
/**
 * Check if the node has matching object or properties
 */
Check if the node has matching object or properties
Check if the node has matching object or properties
function isValid(node, eslintNode, targets) {
  switch (eslintNode.type) {
    case 'CallExpression':
    case 'NewExpression':
      if (!eslintNode.callee) return true;
      if (eslintNode.callee.name !== node.object) return true;
      break;
    case 'MemberExpression':
      if (!eslintNode.object || !eslintNode.property) return true;
      if (eslintNode.object.name !== node.object) return true; 
      if (!node.property) break;
      if (eslintNode.property.name !== node.property) return true;
      break;
    default:
      return true;
  }
  return getUnsupportedTargets(node, targets).length === 0;
} 
function isValid ( node , eslintNode , targets ) { switch ( eslintNode . type ) { case 'CallExpression' : case 'NewExpression' : if ( ! eslintNode . callee ) return true ; if ( eslintNode . callee . name !== node . object ) return true ; break ; case 'MemberExpression' : if ( ! eslintNode . object || ! eslintNode . property ) return true ; if ( eslintNode . object . name !== node . object ) return true ; if ( ! node . property ) break ; if ( eslintNode . property . name !== node . property ) return true ; break ; default : return true ; } return getUnsupportedTargets ( node , targets ) . length === 0 ; }
Check if the node has matching object or properties
Check if the node has matching object or properties
// Pass tests if non-matching object or property // If the property is missing from the rule, it means that only the // object is required to determine compatibility //