Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Cheng <ericcheng9316@gmail.com>
  • Loading branch information
matthewmayer and import-brain committed Mar 26, 2023
1 parent 044a6a8 commit 561dd95
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/modules/airline/index.ts
Expand Up @@ -65,7 +65,7 @@ const aircraftTypeSeats: Record<AircraftType, string[]> = {
*
* ### Overview
*
* Several methods in this module return objects rather than strings. You can use for example `faker.airline.airport().iataCode` to pick out the specific property you need.
* Several methods in this module return objects rather than strings. For example, you can use `faker.airline.airport().iataCode` to pick out the specific property you need.
*
* For a random airport, use [`airport()`](https://next.fakerjs.dev/api/airline.html#airport).
*
Expand All @@ -75,7 +75,7 @@ const aircraftTypeSeats: Record<AircraftType, string[]> = {
*
* ### Related Modules
*
* - For sample passenger data you can use the methods of the [`faker.person`](https://next.fakerjs.dev/api/person.html) module.
* - To generate sample passenger data, you can use the methods of the [`faker.person`](https://next.fakerjs.dev/api/person.html) module.
*/
export class AirlineModule {
constructor(private readonly faker: Faker) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/animal/index.ts
Expand Up @@ -5,7 +5,7 @@ import type { Faker } from '../..';
*
* ### Overview
*
* For a general type of animal e.g. `'dog'`, use [`type()`](https://next.fakerjs.dev/api/animal.html#type).
* For a general type of animal (e.g. `'dog'`), use [`type()`](https://next.fakerjs.dev/api/animal.html#type).
*
* Otherwise, use one of the more specific methods, such as [`cat()`](https://next.fakerjs.dev/api/animal.html#cat) for a specific breed of cat.
*
Expand Down
2 changes: 1 addition & 1 deletion src/modules/color/index.ts
Expand Up @@ -168,7 +168,7 @@ function toColorFormat(
*
* For a human-readable color like `'red'`, use [`human()`](https://next.fakerjs.dev/api/color.html#human).
*
* For a hex color like `#ff0000` used in HTML/CSS use [`rgb()`](https://next.fakerjs.dev/api/color.html#rgb). There are also methods for other color formats such as [`hsl()`](https://next.fakerjs.dev/api/color.html#hsl), [`cmyk()`](https://next.fakerjs.dev/api/color.html#cmyk), [`hwb()`](https://next.fakerjs.dev/api/color.html#hwb), [`lab()`](https://next.fakerjs.dev/api/color.html#lab) and [`lch()`](https://next.fakerjs.dev/api/color.html#lch).
* For a hex color like `#ff0000` used in HTML/CSS, use [`rgb()`](https://next.fakerjs.dev/api/color.html#rgb). There are also methods for other color formats such as [`hsl()`](https://next.fakerjs.dev/api/color.html#hsl), [`cmyk()`](https://next.fakerjs.dev/api/color.html#cmyk), [`hwb()`](https://next.fakerjs.dev/api/color.html#hwb), [`lab()`](https://next.fakerjs.dev/api/color.html#lab), and [`lch()`](https://next.fakerjs.dev/api/color.html#lch).
*/
export class ColorModule {
constructor(private readonly faker: Faker) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/commerce/index.ts
Expand Up @@ -6,9 +6,9 @@ import { deprecated } from '../../internal/deprecated';
*
* ### Overview
*
* For a long product name like `'Incredible Soft Gloves'`, use [`productName()`](https://next.fakerjs.dev/api/commerce.html#productname). The product names are generated from a list of adjectives, materials, and products, which can also be accessed seperately using [`productAdjective()`](https://next.fakerjs.dev/api/commerce.html#productadjective), [`productMaterial()`](https://next.fakerjs.dev/api/commerce.html#productmaterial) and [`product()`](https://next.fakerjs.dev/api/commerce.html#product). You can also create a description using [`productDescription()`](https://next.fakerjs.dev/api/commerce.html#productdescription).
* For a long product name like `'Incredible Soft Gloves'`, use [`productName()`](https://next.fakerjs.dev/api/commerce.html#productname). The product names are generated from a list of adjectives, materials, and products, which can each be accessed separately using [`productAdjective()`](https://next.fakerjs.dev/api/commerce.html#productadjective), [`productMaterial()`](https://next.fakerjs.dev/api/commerce.html#productmaterial), and [`product()`](https://next.fakerjs.dev/api/commerce.html#product). You can also create a description using [`productDescription()`](https://next.fakerjs.dev/api/commerce.html#productdescription).
*
* For a department in a shop, or product category, use [`department()`](https://next.fakerjs.dev/api/commerce.html#department).
* For a department in a shop or product category, use [`department()`](https://next.fakerjs.dev/api/commerce.html#department).
*
* You can also create a price using [`price()`](https://next.fakerjs.dev/api/commerce.html#price).
*/
Expand Down
4 changes: 2 additions & 2 deletions src/modules/company/index.ts
Expand Up @@ -6,9 +6,9 @@ import { deprecated } from '../../internal/deprecated';
*
* ### Overview
*
* To generate a random company name use [`name()`](https://next.fakerjs.dev/api/company.html#name). This is localized in many locales.
* To generate a random company name, use [`name()`](https://next.fakerjs.dev/api/company.html#name). This is localized in many locales.
*
* To generate jargon-filled company catchphrases and buzzwords use [`catchPhrase()`](https://next.fakerjs.dev/api/company.html#catchphrase) or [`buzzPhrase()`](https://next.fakerjs.dev/api/company.html#buzzphrase).
* To generate jargon-filled company catchphrases and buzzwords, use [`catchPhrase()`](https://next.fakerjs.dev/api/company.html#catchphrase) or [`buzzPhrase()`](https://next.fakerjs.dev/api/company.html#buzzphrase).
*
* ### Related Modules
*
Expand Down
4 changes: 2 additions & 2 deletions src/modules/hacker/index.ts
Expand Up @@ -5,11 +5,11 @@ import type { Faker } from '../..';
*
* ### Overview
*
* There are methods for different parts of speech, such as [`abbreviation()`](https://next.fakerjs.dev/api/hacker.html#abbreviation), [`adjective()`](https://next.fakerjs.dev/api/hacker.html#adjective), [`noun()`](https://next.fakerjs.dev/api/hacker.html#noun), [`verb()`](https://next.fakerjs.dev/api/hacker.html#verb), [`ingverb()`](https://next.fakerjs.dev/api/hacker.html#ingverb). Alternatively [`phrase()`](https://next.fakerjs.dev/api/hacker.html#phrase) creates a longer phrase combining these words.
* There are methods for different parts of speech, such as [`abbreviation()`](https://next.fakerjs.dev/api/hacker.html#abbreviation), [`adjective()`](https://next.fakerjs.dev/api/hacker.html#adjective), [`noun()`](https://next.fakerjs.dev/api/hacker.html#noun), [`verb()`](https://next.fakerjs.dev/api/hacker.html#verb), and [`ingverb()`](https://next.fakerjs.dev/api/hacker.html#ingverb). Alternatively, [`phrase()`](https://next.fakerjs.dev/api/hacker.html#phrase) creates a longer phrase combining these words.
*
* ### Related modules
*
* Various other modules allow for generating other types of words and phrases:
* Various modules allow for generating other types of words and phrases:
*
* - [faker.word](https://next.fakerjs.dev/api/word.html) uses general vocabulary rather than hacker-specific terms.
* - [faker.lorem](https://next.fakerjs.dev/api/lorem.html) uses faux-Latin "lorem ipsum" text.
Expand Down
4 changes: 2 additions & 2 deletions src/modules/helpers/index.ts
Expand Up @@ -9,11 +9,11 @@ import * as uniqueExec from './unique';
*
* ### Overview
*
* A particularly helpful method is [`arrayElement()`](https://next.fakerjs.dev/api/helpers.html#arrayelement) which returns a random element from an array. This is useful when adding your own custom data which Faker doesn't contain.
* A particularly helpful method is [`arrayElement()`](https://next.fakerjs.dev/api/helpers.html#arrayelement) which returns a random element from an array. This is useful when adding custom data that Faker doesn't contain.
*
* There are alternatives of this method for objects ([`objectKey()`](https://next.fakerjs.dev/api/helpers.html#objectkey) and [`objectValue()`](https://next.fakerjs.dev/api/helpers.html#objectvalue)) and enums ([`enumValue()`](https://next.fakerjs.dev/api/helpers.html#enumvalue)). You can also return multiple elements ([`arrayElements()`](https://next.fakerjs.dev/api/helpers.html#arrayelements)) or elements according to a weighting ([`weightedArrayElement()`](https://next.fakerjs.dev/api/helpers.html#weightedarrayelement)).
*
* A number of methods can generate strings according to various patterns: [`replaceSymbols()`](https://next.fakerjs.dev/api/helpers.html#replacesymbols), [`replaceSymbolWithNumber()`](https://next.fakerjs.dev/api/helpers.html#replacesymbolwithnumber) and [`regexpStyleStringParse()`](https://next.fakerjs.dev/api/helpers.html#regexpstylestringparse).
* A number of methods can generate strings according to various patterns: [`replaceSymbols()`](https://next.fakerjs.dev/api/helpers.html#replacesymbols), [`replaceSymbolWithNumber()`](https://next.fakerjs.dev/api/helpers.html#replacesymbolwithnumber), and [`regexpStyleStringParse()`](https://next.fakerjs.dev/api/helpers.html#regexpstylestringparse).
*/
export class HelpersModule {
constructor(private readonly faker: Faker) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/image/index.ts
Expand Up @@ -10,13 +10,13 @@ import { Unsplash } from './providers/unsplash';
*
* ### Overview
*
* For a random image use [`url()`](https://next.fakerjs.dev/api/image.html#url). This will not return the image directly, but a URL pointing to an image from one of two demo image providers "Picsum" and "LoremFlickr". You can request an image specifically from one of the two providers using [`urlLoremFlickr()`](https://next.fakerjs.dev/api/image.html#urlloremflickr) or [`urlPicsum()`](https://next.fakerjs.dev/api/image.html#urlpicsum).
* For a random image, use [`url()`](https://next.fakerjs.dev/api/image.html#url). This will not return the image directly but a URL pointing to an image from one of two demo image providers "Picsum" and "LoremFlickr". You can request an image specifically from one of two providers using [`urlLoremFlickr()`](https://next.fakerjs.dev/api/image.html#urlloremflickr) or [`urlPicsum()`](https://next.fakerjs.dev/api/image.html#urlpicsum).
*
* For a random placeholder image containing only solid color and text, use [`urlPlaceholder()`](https://next.fakerjs.dev/api/image.html#urlplaceholder) (uses a third-party service) or [`dataUri()`](https://next.fakerjs.dev/api/image.html#datauri) (returns a SVG string).
*
* For a random user avatar image, use [`avatar()`](https://next.fakerjs.dev/api/image.html#avatar).
*
* This module previously also contained methods for specifically themed images like "fashion" or "food", but these are now deprecated. If you need more control over image type, you are recommended to use an image provider directly or use your own set of placeholder images.
* This module previously also contained methods for specifically themed images like "fashion" or "food", but these are now deprecated. If you need more control over image type, you are recommended to use an image provider directly or provide your own set of placeholder images.
*/
export class ImageModule {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/modules/internet/index.ts
Expand Up @@ -31,11 +31,11 @@ export type HTTPProtocolType = 'http' | 'https';
*
* For user accounts, you may need an [`email()`](https://next.fakerjs.dev/api/internet.html#email) and a [`password()`](https://next.fakerjs.dev/api/internet.html#password), as well as a ASCII [`userName()`](https://next.fakerjs.dev/api/internet.html#username) or Unicode [`displayName()`](https://next.fakerjs.dev/api/internet.html#displayname), and an image [`avatar()`](https://next.fakerjs.dev/api/internet.html#avatar). Since the emails generated could coincidentally be real email addresses, you should not use these for sending real email addresses. If this is a concern, use [`exampleEmail()`](https://next.fakerjs.dev/api/internet.html#exampleemail) instead.
*
* For websites you can use generate a [`domainName()`](https://next.fakerjs.dev/api/internet.html#domainname) or a full [`url()`](https://next.fakerjs.dev/api/internet.html#url).
* For websites, you can generate a [`domainName()`](https://next.fakerjs.dev/api/internet.html#domainname) or a full [`url()`](https://next.fakerjs.dev/api/internet.html#url).
*
* To make your data more 🔥, you can also use [`emoji()`](https://next.fakerjs.dev/api/internet.html#emoji).
* To make your data more 🔥, you can use [`emoji()`](https://next.fakerjs.dev/api/internet.html#emoji).
*
* You also have access to a number of more technical elements of web requests, such as [`httpMethod`](https://next.fakerjs.dev/api/internet.html#httpmethod), [`httpStatusCode`](https://next.fakerjs.dev/api/internet.html#httpstatuscode), [`ip`](https://next.fakerjs.dev/api/internet.html#ip), [`mac`](https://next.fakerjs.dev/api/internet.html#mac), [`userAgent`](https://next.fakerjs.dev/api/internet.html#useragent), and [`port`](https://next.fakerjs.dev/api/internet.html#port).
* You also have access to a number of the more technical elements of web requests, such as [`httpMethod`](https://next.fakerjs.dev/api/internet.html#httpmethod), [`httpStatusCode`](https://next.fakerjs.dev/api/internet.html#httpstatuscode), [`ip`](https://next.fakerjs.dev/api/internet.html#ip), [`mac`](https://next.fakerjs.dev/api/internet.html#mac), [`userAgent`](https://next.fakerjs.dev/api/internet.html#useragent), and [`port`](https://next.fakerjs.dev/api/internet.html#port).
*/
export class InternetModule {
constructor(private readonly faker: Faker) {
Expand Down
6 changes: 3 additions & 3 deletions src/modules/location/index.ts
Expand Up @@ -2,13 +2,13 @@ import type { Faker } from '../..';
import { deprecated } from '../../internal/deprecated';

/**
* Module to generate addresses and locations. Prior to Faker 8.0.0 this module was known as `faker.address`.
* Module to generate addresses and locations. Prior to Faker 8.0.0, this module was known as `faker.address`.
*
* ### Overview
*
* For a typical street address for a locale use [`streetAddress()`](https://next.fakerjs.dev/api/location.html#streetaddress), [`city()`](https://next.fakerjs.dev/api/location.html#city), [`state()`](https://next.fakerjs.dev/api/location.html#state) (or [`stateAbbr()`](https://next.fakerjs.dev/api/location.html#stateabbr)) and [`zipCode()`](https://next.fakerjs.dev/api/location.html#zipcode). Most locales provide localized versions for a specific country.
* For a typical street address for a locale, use [`streetAddress()`](https://next.fakerjs.dev/api/location.html#streetaddress), [`city()`](https://next.fakerjs.dev/api/location.html#city), [`state()`](https://next.fakerjs.dev/api/location.html#state) (or [`stateAbbr()`](https://next.fakerjs.dev/api/location.html#stateabbr)), and [`zipCode()`](https://next.fakerjs.dev/api/location.html#zipcode). Most locales provide localized versions for a specific country.
*
* If you need latitude and longitude coordinates, use [`latitude()`](https://next.fakerjs.dev/api/location.html#latitude) and [`longitude()`](https://next.fakerjs.dev/api/location.html#longitude) or [`nearbyGPSCoordinate()`](https://next.fakerjs.dev/api/location.html#nearbygpscoordinate) for a latitude/longitude near a given location.
* If you need latitude and longitude coordinates, use [`latitude()`](https://next.fakerjs.dev/api/location.html#latitude) and [`longitude()`](https://next.fakerjs.dev/api/location.html#longitude), or [`nearbyGPSCoordinate()`](https://next.fakerjs.dev/api/location.html#nearbygpscoordinate) for a latitude/longitude near a given location.
*
* For a random country, you can use [`country()`](https://next.fakerjs.dev/api/location.html#country) or [`countryCode()`](https://next.fakerjs.dev/api/location.html#countrycode).
*/
Expand Down
4 changes: 2 additions & 2 deletions src/modules/lorem/index.ts
Expand Up @@ -8,9 +8,9 @@ import { filterWordListByLength } from '../word/filterWordListByLength';
*
* Generate dummy content using traditional faux-Latin [lorem ipsum](https://en.wikipedia.org/wiki/Lorem_ipsum) (in other locales to `en`, alternative words may be used).
*
* In order of increasing size you can generate a single [`word()`](https://next.fakerjs.dev/api/lorem.html#word), multiple [`words()`](https://next.fakerjs.dev/api/lorem.html#words), a [`sentence()`](https://next.fakerjs.dev/api/lorem.html#sentence), multiple [`sentences()`](https://next.fakerjs.dev/api/lorem.html#sentences) or [`lines()`](https://next.fakerjs.dev/api/lorem.html#lines) (seperated by newlines), one [`paragraph()`](https://next.fakerjs.dev/api/lorem.html#paragraph) or multiple [`paragraphs()`](https://next.fakerjs.dev/api/lorem.html#paragraphs).
* In order of increasing size you can generate a single [`word()`](https://next.fakerjs.dev/api/lorem.html#word), multiple [`words()`](https://next.fakerjs.dev/api/lorem.html#words), a [`sentence()`](https://next.fakerjs.dev/api/lorem.html#sentence), multiple [`sentences()`](https://next.fakerjs.dev/api/lorem.html#sentences), [`lines()`](https://next.fakerjs.dev/api/lorem.html#lines) separated by newlines, one [`paragraph()`](https://next.fakerjs.dev/api/lorem.html#paragraph), or multiple [`paragraphs()`](https://next.fakerjs.dev/api/lorem.html#paragraphs).
*
* The generic [`text()`](https://next.fakerjs.dev/api/lorem.html#text) method can be used to generate a text between one sentence and multiple paragraphs, while [`slug()`](https://next.fakerjs.dev/api/lorem.html#slug) generates an URL-friendly hyphenated string.
* The generic [`text()`](https://next.fakerjs.dev/api/lorem.html#text) method can be used to generate some text between one sentence and multiple paragraphs, while [`slug()`](https://next.fakerjs.dev/api/lorem.html#slug) generates an URL-friendly hyphenated string.
*/
export class LoremModule {
constructor(private readonly faker: Faker) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/number/index.ts
Expand Up @@ -9,7 +9,7 @@ import type { Mersenne } from '../../internal/mersenne/mersenne';
*
* For simple integers, use [`int()`](https://next.fakerjs.dev/api/number.html#int). For decimal/floating-point numbers, use [`float()`](https://next.fakerjs.dev/api/number.html#float).
*
* For numbers that are not in base-10 you can use [`hex()`](https://next.fakerjs.dev/api/number.html#hex), [`octal()`](https://next.fakerjs.dev/api/number.html#octal) and [`binary()`](https://next.fakerjs.dev/api/number.html#binary)`.
* For numbers not in base-10, you can use [`hex()`](https://next.fakerjs.dev/api/number.html#hex), [`octal()`](https://next.fakerjs.dev/api/number.html#octal) and [`binary()`](https://next.fakerjs.dev/api/number.html#binary)`.
*
* ### Related modules
*
Expand Down

0 comments on commit 561dd95

Please sign in to comment.