Skip to content

Commit

Permalink
docs: update all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Dec 29, 2024
1 parent 3e73e88 commit 5b7e38f
Show file tree
Hide file tree
Showing 28 changed files with 759 additions and 780 deletions.
4 changes: 2 additions & 2 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export class Faker extends SimpleFaker {
* @example
* import { faker, fakerES_MX } from '@faker-js/faker';
* // const { faker, fakerES_MX } = require("@faker-js/faker")
* faker.getMetadata(); // { title: 'English', code: 'en', language: 'en', endonym: 'English', dir: 'ltr', script: 'Latn' }
* fakerES_MX.getMetadata(); // { title: 'Spanish (Mexico)', code: 'es_MX', language: 'es', endonym: 'Español (México)', dir: 'ltr', script: 'Latn', country: 'MX' }
* faker.getMetadata(); // { 'title': 'English', 'code': 'en', 'language': 'en', 'endonym': 'English', 'dir': 'ltr', 'script': 'Latn' }
* fakerES_MX.getMetadata(); // { 'title': 'Spanish (Mexico)', 'code': 'es_MX', 'language': 'es', 'endonym': 'Español (México)', 'dir': 'ltr', 'script': 'Latn', 'country': 'MX' }
*
* @since 8.1.0
*/
Expand Down
34 changes: 17 additions & 17 deletions src/modules/airline/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class AirlineModule extends ModuleBase {
* Generates a random airport.
*
* @example
* faker.airline.airport() // { name: 'Dallas Fort Worth International Airport', iataCode: 'DFW' }
* faker.airline.airport() // { 'name': 'Leonardo da Vinci-Fiumicino Airport', 'iataCode': 'FCO' }
*
* @since 8.0.0
*/
Expand All @@ -96,7 +96,7 @@ export class AirlineModule extends ModuleBase {
* Generates a random airline.
*
* @example
* faker.airline.airline() // { name: 'American Airlines', iataCode: 'AA' }
* faker.airline.airline() // { 'name': 'Korean Air', 'iataCode': 'KE' }
*
* @since 8.0.0
*/
Expand All @@ -110,7 +110,7 @@ export class AirlineModule extends ModuleBase {
* Generates a random airplane.
*
* @example
* faker.airline.airplane() // { name: 'Airbus A321neo', iataTypeCode: '32Q' }
* faker.airline.airplane() // { 'name': 'Canadair CL-44', 'iataTypeCode': 'CL4' }
*
* @since 8.0.0
*/
Expand All @@ -130,10 +130,10 @@ export class AirlineModule extends ModuleBase {
* @param options.allowVisuallySimilarCharacters Whether to allow visually similar characters such as '1' and 'I'. Defaults to `false`.
*
* @example
* faker.airline.recordLocator() // 'KIFRWE'
* faker.airline.recordLocator({ allowNumerics: true }) // 'E5TYEM'
* faker.airline.recordLocator({ allowVisuallySimilarCharacters: true }) // 'ANZNEI'
* faker.airline.recordLocator({ allowNumerics: true, allowVisuallySimilarCharacters: true }) // '1Z2Z3E'
* faker.airline.recordLocator() // 'PTQPKR'
* faker.airline.recordLocator({ allowNumerics: true }) // 'FWYDTJ'
* faker.airline.recordLocator({ allowVisuallySimilarCharacters: true }) // 'OYBCAV'
* faker.airline.recordLocator({ allowNumerics: true, allowVisuallySimilarCharacters: true }) // 'SVZSGS'
*
* @since 8.0.0
*/
Expand Down Expand Up @@ -178,9 +178,9 @@ export class AirlineModule extends ModuleBase {
* @param options.aircraftType The aircraft type. Can be one of `narrowbody`, `regional`, `widebody`. Defaults to `narrowbody`.
*
* @example
* faker.airline.seat() // '22C'
* faker.airline.seat({ aircraftType: 'regional' }) // '7A'
* faker.airline.seat({ aircraftType: 'widebody' }) // '42K'
* faker.airline.seat() // '20E'
* faker.airline.seat({ aircraftType: 'regional' }) // '13C'
* faker.airline.seat({ aircraftType: 'widebody' }) // '26G'
*
* @since 8.0.0
*/
Expand All @@ -206,7 +206,7 @@ export class AirlineModule extends ModuleBase {
* Returns a random aircraft type.
*
* @example
* faker.airline.aircraftType() // 'narrowbody'
* faker.airline.aircraftType() // 'regional'
*
* @since 8.0.0
*/
Expand All @@ -230,12 +230,12 @@ export class AirlineModule extends ModuleBase {
* @param options.addLeadingZeros Whether to pad the flight number up to 4 digits with leading zeros. Defaults to `false`.
*
* @example
* faker.airline.flightNumber() // '2405'
* faker.airline.flightNumber({ addLeadingZeros: true }) // '0249'
* faker.airline.flightNumber({ addLeadingZeros: true, length: 2 }) // '0042'
* faker.airline.flightNumber({ addLeadingZeros: true, length: { min: 2, max: 3 } }) // '0624'
* faker.airline.flightNumber({ length: 3 }) // '425'
* faker.airline.flightNumber({ length: { min: 2, max: 3 } }) // '84'
* faker.airline.flightNumber() // '765'
* faker.airline.flightNumber({ addLeadingZeros: true }) // '0064'
* faker.airline.flightNumber({ addLeadingZeros: true, length: 2 }) // '0099'
* faker.airline.flightNumber({ addLeadingZeros: true, length: { min: 2, max: 3 } }) // '0085'
* faker.airline.flightNumber({ length: 3 }) // '690'
* faker.airline.flightNumber({ length: { min: 2, max: 3 } }) // '18'
*
* @since 8.0.0
*/
Expand Down
32 changes: 16 additions & 16 deletions src/modules/animal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random dog breed.
*
* @example
* faker.animal.dog() // 'Irish Water Spaniel'
* faker.animal.dog() // 'Kuvasz'
*
* @since 5.5.0
*/
Expand All @@ -28,7 +28,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random cat breed.
*
* @example
* faker.animal.cat() // 'Singapura'
* faker.animal.cat() // 'Norwegian Forest Cat'
*
* @since 5.5.0
*/
Expand All @@ -40,7 +40,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random snake species.
*
* @example
* faker.animal.snake() // 'Eyelash viper'
* faker.animal.snake() // "Malcolm's tree viper"
*
* @since 5.5.0
*/
Expand All @@ -52,7 +52,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random bear species.
*
* @example
* faker.animal.bear() // 'Asian black bear'
* faker.animal.bear() // 'Polar bear'
*
* @since 5.5.0
*/
Expand All @@ -64,7 +64,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random lion species.
*
* @example
* faker.animal.lion() // 'Northeast Congo Lion'
* faker.animal.lion() // 'Masai Lion'
*
* @since 5.5.0
*/
Expand All @@ -76,7 +76,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random cetacean species.
*
* @example
* faker.animal.cetacean() // 'Spinner Dolphin'
* faker.animal.cetacean() // 'Irrawaddy Dolphin'
*
* @since 5.5.0
*/
Expand All @@ -90,7 +90,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random horse breed.
*
* @example
* faker.animal.horse() // 'Swedish Warmblood'
* faker.animal.horse() // "M'Par"
*
* @since 5.5.0
*/
Expand All @@ -102,7 +102,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random bird species.
*
* @example
* faker.animal.bird() // 'Buller's Shearwater'
* faker.animal.bird() // 'Magnificent Frigatebird'
*
* @since 5.5.0
*/
Expand All @@ -114,7 +114,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random cow species.
*
* @example
* faker.animal.cow() // 'Brava'
* faker.animal.cow() // 'Kenana cattle'
*
* @since 5.5.0
*/
Expand All @@ -126,7 +126,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random fish species.
*
* @example
* faker.animal.fish() // 'Mandarin fish'
* faker.animal.fish() // 'Japanese jack mackerel'
*
* @since 5.5.0
*/
Expand All @@ -138,7 +138,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random crocodilian species.
*
* @example
* faker.animal.crocodilia() // 'Philippine Crocodile'
* faker.animal.crocodilia() // 'New Guinea Freshwater Crocodile'
*
* @since 5.5.0
*/
Expand All @@ -152,7 +152,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random insect species.
*
* @example
* faker.animal.insect() // 'Pyramid ant'
* faker.animal.insect() // 'Mossyrose gall wasp'
*
* @since 5.5.0
*/
Expand All @@ -166,7 +166,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random rabbit species.
*
* @example
* faker.animal.rabbit() // 'Florida White'
* faker.animal.rabbit() // 'Havana'
*
* @since 5.5.0
*/
Expand All @@ -180,7 +180,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random rodent breed.
*
* @example
* faker.animal.rodent() // 'Cuscomys ashanika'
* faker.animal.rodent() // 'Indian porcupine'
*
* @since 7.4.0
*/
Expand All @@ -194,7 +194,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random animal type.
*
* @example
* faker.animal.type() // 'crocodile'
* faker.animal.type() // 'koala'
*
* @since 5.5.0
*/
Expand All @@ -206,7 +206,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random pet name.
*
* @example
* faker.animal.petName() // 'Coco'
* faker.animal.petName() // 'Leo'
*
* @since 9.2.0
*/
Expand Down
10 changes: 5 additions & 5 deletions src/modules/book/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class BookModule extends ModuleBase {
* Returns a random author name.
*
* @example
* faker.book.author() // 'William Shakespeare'
* faker.book.author() // 'Joseph Conrad'
*
* @since 9.1.0
*/
Expand All @@ -45,7 +45,7 @@ export class BookModule extends ModuleBase {
* Returns a random genre.
*
* @example
* faker.book.genre() // 'Fantasy'
* faker.book.genre() // 'Memoir'
*
* @since 9.1.0
*/
Expand All @@ -57,7 +57,7 @@ export class BookModule extends ModuleBase {
* Returns a random publisher.
*
* @example
* faker.book.publisher() // 'Addison-Wesley'
* faker.book.publisher() // 'Jarrolds Publishing'
*
* @since 9.1.0
*/
Expand All @@ -71,7 +71,7 @@ export class BookModule extends ModuleBase {
* Returns a random series.
*
* @example
* faker.book.series() // 'Harry Potter'
* faker.book.series() // 'The Dresden Files'
*
* @since 9.1.0
*/
Expand All @@ -83,7 +83,7 @@ export class BookModule extends ModuleBase {
* Returns a random title.
*
* @example
* faker.book.title() // 'Romeo and Juliet'
* faker.book.title() // 'Second Treatise of Government'
*
* @since 9.1.0
*/
Expand Down
Loading

0 comments on commit 5b7e38f

Please sign in to comment.