<commit_before>// external dependencies
var astUtils = require('eslint/lib/ast-utils');
var naturalCompare = require('natural-compare');

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * @function getPropertyName
 *
 * @private
 *
 * @description
 * Gets the property name of the given `Property` node.
 *
 * - If the property's key is an `Identifier` node, this returns the key's name
 *   whether it's a computed property or not.
 * - If the property has a static name, this returns the static name.
 * - Otherwise, this returns null.
 *
 * @param {ASTNode} node - The `Property` node to get.
 * @returns {string|null} The property name or null.
 */
function getPropertyName(node) {
  return astUtils.getStaticPropertyName(node) || node.key.name || null;
}

function getSortingPropertyName(property) {
  if (property.type === 'ExperimentalSpreadProperty') {
    return `...${property.argument.name}`;
  }

  if (property.key.type === 'Literal') {
    return property.key.value;
  }

  if (property.key.type === 'Identifier') {
    return property.key.name;
  }
}

/**
 * @function isSpreadOperator
 *
 * @private
 *
 * @description
 * is the string passed a spread operator
 *
 * @param {string} string the string to test
 * @returns {boolean} is the string a spread operator
 */
function isSpreadOperator(string) {
  return string ? string.slice(0, 3) === '...' : false;<commit_msg>Add JSDoc for getSortingPropertyNames<commit_after>// external dependencies
var astUtils = require('eslint/lib/ast-utils');
var naturalCompare = require('natural-compare');

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * @function getPropertyName
 *
 * @private
 *
 * @description
 * Gets the property name of the given `Property` node.
 *
 * - If the property's key is an `Identifier` node, this returns the key's name
 *   whether it's a computed property or not.
 * - If the property has a static name, this returns the static name.
 * - Otherwise, this returns null.
 *
 * @param {ASTNode} node - The `Property` node to get.
 * @returns {string|null} The property name or null.
 */
function getPropertyName(node) {
  return astUtils.getStaticPropertyName(node) || node.key.name || null;
}

/**
 * @function getSortingPropertyName
 *
 * @description
 * get the name used for sorting purposes
 *
 * @param {Object} property the property to get the name from
 * @returns {string} the property name used for sorting
 */
function getSortingPropertyName(property) {
  if (property.type === 'ExperimentalSpreadProperty') {
    return `...${property.argument.name}`;
  }

  if (property.key.type === 'Literal') {
    return property.key.value;
  }

  if (property.key.type === 'Identifier') {
    return property.key.name;
  }
}

/**
 * @function isSpreadOperator
 *
 * @private
 *
 * @description
 * is the string passed a spread operator
 *
 * @param {string} string the string to test
 * @returns {boolean} is the string a spread operator
 */
function isSpreadOperator(string) {
  return string ? string.slice(0, 3) === '...' : false;
{'fraction_non_alphanumeric': 0.2143727161997564, 'fraction_numerical': 0.001218026796589525, 'mean_word_length': 2.4615384615384617, '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': '1528666', 'n_tokens_mistral': 890, 'n_tokens_neox': 874, 'n_words': 290}