Skip to content

Commit

Permalink
docs: update since tags for person and location (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Mayer authored Nov 6, 2022
1 parent 0b9989f commit 1bed403
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
42 changes: 21 additions & 21 deletions src/modules/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class LocationModule {
* faker.location.zipCode() // '17839'
* faker.location.zipCode('####') // '6925'
*
* @since 2.0.1
* @since 8.0.0
*/
zipCode(format?: string): string {
// if zip format is not specified, use the zip format defined for the locale
Expand Down Expand Up @@ -55,7 +55,7 @@ export class LocationModule {
* fakerUS.location.zipCodeByState("AK") // '99595'
* fakerUS.location.zipCodeByState("??") // '47683-9880'
*
* @since 5.0.0
* @since 8.0.0
*/
zipCodeByState(state: string): string {
const zipRange = this.faker.definitions.location.postcode_by_state?.[state];
Expand All @@ -71,7 +71,7 @@ export class LocationModule {
* @example
* faker.location.city() // 'East Jarretmouth'
*
* @since 2.0.1
* @since 8.0.0
*/
city(): string {
const pattern = this.faker.helpers.arrayElement(
Expand All @@ -86,7 +86,7 @@ export class LocationModule {
* @example
* faker.location.cityName() // 'San Rafael'
*
* @since 5.5.0
* @since 8.0.0
*/
cityName(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -100,7 +100,7 @@ export class LocationModule {
* @example
* faker.location.buildingNumber() // '379'
*
* @since 6.2.0
* @since 8.0.0
*/
buildingNumber(): string {
const format = this.faker.helpers.arrayElement(
Expand All @@ -116,7 +116,7 @@ export class LocationModule {
* @example
* faker.location.street() // 'Schroeder Isle'
*
* @since 7.0.0
* @since 8.0.0
*/
street(): string {
const format = this.faker.helpers.arrayElement(
Expand All @@ -131,7 +131,7 @@ export class LocationModule {
* @example
* fakerDE.location.streetName() // 'Cavill Avenue'
*
* @since 2.0.1
* @since 8.0.0
*/
streetName(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -150,7 +150,7 @@ export class LocationModule {
* faker.location.streetAddress(false) // '34830 Erdman Hollow'
* faker.location.streetAddress(true) // '3393 Ronny Way Apt. 742'
*
* @since 2.0.1
* @since 8.0.0
*/
streetAddress(useFullAddress: boolean = false): string {
const formats = this.faker.definitions.location.street_address;
Expand All @@ -166,7 +166,7 @@ export class LocationModule {
* @example
* faker.location.secondaryAddress() // 'Apt. 861'
*
* @since 2.0.1
* @since 8.0.0
*/
secondaryAddress(): string {
return this.faker.helpers.replaceSymbolWithNumber(
Expand All @@ -182,7 +182,7 @@ export class LocationModule {
* @example
* faker.location.county() // 'Cambridgeshire'
*
* @since 2.0.1
* @since 8.0.0
*/
county(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -196,7 +196,7 @@ export class LocationModule {
* @example
* faker.location.country() // 'Greece'
*
* @since 2.0.1
* @since 8.0.0
*/
country(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -215,7 +215,7 @@ export class LocationModule {
* faker.location.countryCode('alpha-2') // 'GA'
* faker.location.countryCode('alpha-3') // 'TJK'
*
* @since 3.0.0
* @since 8.0.0
*/
countryCode(alphaCode: 'alpha-2' | 'alpha-3' = 'alpha-2'): string {
const key =
Expand All @@ -232,7 +232,7 @@ export class LocationModule {
* @example
* faker.location.state() // 'Georgia'
*
* @since 2.0.1
* @since 8.0.0
*/
state(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -246,7 +246,7 @@ export class LocationModule {
* @example
* faker.location.stateAbbr() // 'ND'
*
* @since 2.0.1
* @since 8.0.0
*/
stateAbbr(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -265,7 +265,7 @@ export class LocationModule {
* faker.location.latitude() // -30.9501
* faker.location.latitude(10, -10, 5) // 2.68452
*
* @since 2.0.1
* @since 8.0.0
*/
// TODO @xDivisionByZerox 2022-06-12 this signature should probably be an object for easier maintainability
latitude(max: number = 90, min: number = -90, precision: number = 4): number {
Expand All @@ -287,7 +287,7 @@ export class LocationModule {
* faker.location.longitude() // -154.0226
* faker.location.longitude(10, -10, 5) // -4.03620
*
* @since 2.0.1
* @since 8.0.0
*/
// TODO @xDivisionByZerox 2022-06-12 this signature should probably be an object for easier maintainability
longitude(
Expand All @@ -313,7 +313,7 @@ export class LocationModule {
* faker.location.direction(false) // 'South'
* faker.location.direction(true) // 'NE'
*
* @since 5.0.0
* @since 8.0.0
*/
direction(useAbbr: boolean = false): string {
if (!useAbbr) {
Expand All @@ -337,7 +337,7 @@ export class LocationModule {
* faker.location.cardinalDirection(false) // 'South'
* faker.location.cardinalDirection(true) // 'N'
*
* @since 5.0.0
* @since 8.0.0
*/
cardinalDirection(useAbbr: boolean = false): string {
if (!useAbbr) {
Expand All @@ -361,7 +361,7 @@ export class LocationModule {
* faker.location.ordinalDirection(false) // 'Northwest'
* faker.location.ordinalDirection(true) // 'NE'
*
* @since 5.0.0
* @since 8.0.0
*/
ordinalDirection(useAbbr: boolean = false): string {
if (!useAbbr) {
Expand All @@ -387,7 +387,7 @@ export class LocationModule {
* faker.location.nearbyGPSCoordinate([33, -170]) // [ 33.0165, -170.0636 ]
* faker.location.nearbyGPSCoordinate([33, -170], 1000, true) // [ 37.9163, -179.2408 ]
*
* @since 5.0.0
* @since 8.0.0
*/
nearbyGPSCoordinate(
coordinate?: [latitude: number, longitude: number],
Expand Down Expand Up @@ -445,7 +445,7 @@ export class LocationModule {
* @example
* faker.location.timeZone() // 'Pacific/Guam'
*
* @since 5.1.0
* @since 8.0.0
*/
timeZone(): string {
return this.faker.helpers.arrayElement(
Expand Down
26 changes: 13 additions & 13 deletions src/modules/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class PersonModule {
* faker.person.firstName('female') // 'Victoria'
* faker.person.firstName('male') // 'Tom'
*
* @since 2.0.1
* @since 8.0.0
*/
firstName(sex?: SexType): string {
const { first_name, female_first_name, male_first_name } =
Expand All @@ -104,7 +104,7 @@ export class PersonModule {
* faker.person.lastName('female') // 'Grady'
* faker.person.lastName('male') // 'Barton'
*
* @since 2.0.1
* @since 8.0.0
*/
lastName(sex?: SexType): string {
const { last_name, female_last_name, male_last_name } =
Expand All @@ -128,7 +128,7 @@ export class PersonModule {
* faker.person.middleName('female') // 'Eloise'
* faker.person.middleName('male') // 'Asher'
*
* @since 5.2.0
* @since 8.0.0
*/
middleName(sex?: SexType): string {
const { middle_name, female_middle_name, male_middle_name } =
Expand Down Expand Up @@ -156,7 +156,7 @@ export class PersonModule {
* faker.person.fullName({ lastName: 'Beer' }) // 'Mr. Alfonso Beer'
* faker.person.fullName({ sex: 'male' }) // 'Fernando Schaefer'
*
* @since 7.4.0
* @since 8.0.0
*/
fullName(
options: {
Expand Down Expand Up @@ -202,7 +202,7 @@ export class PersonModule {
* @example
* faker.person.gender() // 'Trans*Man'
*
* @since 5.0.0
* @since 8.0.0
*/
gender(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -221,7 +221,7 @@ export class PersonModule {
* @example
* faker.person.sex() // 'female'
*
* @since 7.5.0
* @since 8.0.0
*/
sex(): string {
return this.faker.helpers.arrayElement(this.faker.definitions.person.sex);
Expand All @@ -233,7 +233,7 @@ export class PersonModule {
* @example
* faker.person.sexType() // Sex.Female
*
* @since 7.5.0
* @since 8.0.0
*/
sexType(): SexType {
return this.faker.helpers.objectValue(Sex);
Expand All @@ -249,7 +249,7 @@ export class PersonModule {
* faker.person.prefix('female') // 'Ms.'
* faker.person.prefix('male') // 'Mr.'
*
* @since 2.0.1
* @since 8.0.0
*/
prefix(sex?: SexType): string {
const { prefix, female_prefix, male_prefix } =
Expand All @@ -268,7 +268,7 @@ export class PersonModule {
* @example
* faker.person.suffix() // 'DDS'
*
* @since 2.0.1
* @since 8.0.0
*/
suffix(): string {
// TODO @Shinigami92 2022-03-21: Add female_suffix and male_suffix
Expand All @@ -283,7 +283,7 @@ export class PersonModule {
* @example
* faker.person.jobTitle() // 'Global Accounts Engineer'
*
* @since 3.0.0
* @since 8.0.0
*/
jobTitle(): string {
return `${this.jobDescriptor()} ${this.jobArea()} ${this.jobType()}`;
Expand All @@ -295,7 +295,7 @@ export class PersonModule {
* @example
* faker.person.jobDescriptor() // 'Customer'
*
* @since 3.0.0
* @since 8.0.0
*/
jobDescriptor(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -309,7 +309,7 @@ export class PersonModule {
* @example
* faker.person.jobArea() // 'Brand'
*
* @since 3.0.0
* @since 8.0.0
*/
jobArea(): string {
return this.faker.helpers.arrayElement(
Expand All @@ -323,7 +323,7 @@ export class PersonModule {
* @example
* faker.person.jobType() // 'Assistant'
*
* @since 3.0.0
* @since 8.0.0
*/
jobType(): string {
return this.faker.helpers.arrayElement(
Expand Down

0 comments on commit 1bed403

Please sign in to comment.