lib/rules/vue/valid-v-model.js
function getVariable (name, leafNode) {
  let node = leafNode

  while (node != null) {
    const variables = node.variables
    const variable = variables && variables.find(v => v.id.name === name)

    if (variable != null) {
      return variable
    }

    node = node.parent
  }

  return null
}
function getVariable (name, leafNode) {
  let node = leafNode

  while (node != null) {
    const variables = node.variables
    const variable = variables && variables.find(v => v.id.name === name)

    if (variable != null) {
      return variable
    }

    node = node.parent
  }

  return null
}
function getVariable ( name , leafNode ) { let node = leafNode while ( node != null ) { const variables = node . variables const variable = variables && variables . find ( v => v . id . name === name ) if ( variable != null ) { return variable } node = node . parent } return null }
Get the variable by names.
@param {string} name The variable name to find.
@param {ASTNode} leafNode The node to look up.
@returns {Variable|null} The found variable or null.
Get the variable by names .