eslint-internal-rules/require-meta-docs-url.js
function getKeyName (property) {
  if (!property.computed && property.key.type === 'Identifier') {
    return property.key.name
  }
  if (property.key.type === 'Literal') {
    return '' + property.key.value
  }
  if (property.key.type === 'TemplateLiteral' && property.key.quasis.length === 1) {
    return property.key.quasis[0].value.cooked
  }
  return null
}
function getKeyName (property) {
  if (!property.computed && property.key.type === 'Identifier') {
    return property.key.name
  }
  if (property.key.type === 'Literal') {
    return '' + property.key.value
  }
  if (property.key.type === 'TemplateLiteral' && property.key.quasis.length === 1) {
    return property.key.quasis[0].value.cooked
  }
  return null
}
function getKeyName ( property ) { if ( ! property . computed && property . key . type === 'Identifier' ) { return property . key . name } if ( property . key . type === 'Literal' ) { return '' + property . key . value } if ( property . key . type === 'TemplateLiteral' && property . key . quasis . length === 1 ) { return property . key . quasis [ 0 ] . value . cooked } return null }
Gets the key name of a Property, if it can be determined statically.
@param {ASTNode} node The `Property` node
@returns {string|null} The key name, or `null` if the name cannot be determined statically.
Gets the key name of a Property if it can be determined statically .