<commit_before>/**
 * @module
 */
import {object, oneOf, constant} from '../../combinators';
import {fromDefinition} from '../../utils';
import {date} from '../datetime.js';

import definitions from './definitions';

/**
 * Arbitrary to generate the first name of a person.
 *
 * @type {Arbitrary}
 * @example
 * // returns Jack.
 * ke.person.firstName.generate();
 */
const firstName = fromDefinition(definitions, 'firstName').name('First Name');

/**
 * Arbitrary to generate the last name of a person.
 *
 * @type {Arbitrary}
 * @example
 * // returns Hand.
 * ke.person.lastName.generate();
 */
const lastName = fromDefinition(definitions, 'lastName').name('Last Name');

/**
 * Aribitrary to generate the name of a person.
 *
 * @type {Arbitrary}
 * @example
 * ke.person.name.generate();
 */
const name = object({
  firstName: firstName,
  lastName: lastName
}).name('Name');

/**
 * Arbitrary to generate the gender of a person.
 *
 * @type {Arbitrary}
 * @example
 * ke.person.gender.generate;
 */
const gender = fromDefinition(definitions, 'gender').name('Gender');

/**
 * Arbitrary to generate a person (alive, dead, undead, or fictional).
 *
 * @type {Arbitrary}
 * @example
 * // generate a object include person name, gender and birthday.
 * ke.person.generate();
 */
const person = object({
  name: name,
  gender: gender,
  brithDay: date
}).name('Person');

person.firstName = firstName;
person.lastName = lastName;
person.gender = gender;

export default person;<commit_msg>Add missing person.name arbitrary.<commit_after>/**
 * @module
 */
import {object, oneOf, constant} from '../../combinators';
import {fromDefinition} from '../../utils';
import {date} from '../datetime.js';

import definitions from './definitions';

/**
 * Arbitrary to generate the first name of a person.
 *
 * @type {Arbitrary}
 * @example
 * // returns Jack.
 * ke.person.firstName.generate();
 */
const firstName = fromDefinition(definitions, 'firstName').name('First Name');

/**
 * Arbitrary to generate the last name of a person.
 *
 * @type {Arbitrary}
 * @example
 * // returns Hand.
 * ke.person.lastName.generate();
 */
const lastName = fromDefinition(definitions, 'lastName').name('Last Name');

/**
 * Aribitrary to generate the name of a person.
 *
 * @type {Arbitrary}
 * @example
 * ke.person.name.generate();
 */
const name = object({
  firstName: firstName,
  lastName: lastName
}).name('Name');

/**
 * Arbitrary to generate the gender of a person.
 *
 * @type {Arbitrary}
 * @example
 * ke.person.gender.generate;
 */
const gender = fromDefinition(definitions, 'gender').name('Gender');

/**
 * Arbitrary to generate a person (alive, dead, undead, or fictional).
 *
 * @type {Arbitrary}
 * @example
 * // generate a object include person name, gender and birthday.
 * ke.person.generate();
 */
const person = object({
  name: name,
  gender: gender,
  brithDay: date
}).name('Person');

person.name = name;
person.firstName = firstName;
person.lastName = lastName;
person.gender = gender;

export default person;
{'fraction_non_alphanumeric': 0.16297520661157025, 'fraction_numerical': 0.0, 'mean_word_length': 3.8493589743589745, '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': '632013', 'n_tokens_mistral': 937, 'n_tokens_neox': 925, 'n_words': 280}