Skip to content

Commit

Permalink
Merge branch 'next' into add-uk-cubdivision-codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Jul 9, 2023
2 parents a706372 + 4a15bd0 commit 1e105c7
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 41 deletions.
2 changes: 1 addition & 1 deletion docs/guide/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('reverse array', () => {

## Cypress

[Cypress](https://www.cypress.io/) integration is fairly straighforward as well:
[Cypress](https://www.cypress.io/) integration is fairly straightforward as well:

```ts
import { faker } from '@faker-js/faker/locale/en';
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { LocaleEntry } from './definitions';
*/
export type ColorDefinition = LocaleEntry<{
/**
* Human readable color names.
* Human-readable color names.
*/
human: string[];

Expand Down
2 changes: 2 additions & 0 deletions src/locales/nl/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import default_country from './default_country';
import postcode from './postcode';
import secondary_address from './secondary_address';
import state from './state';
import state_abbr from './state_abbr';
import street_address from './street_address';
import street_pattern from './street_pattern';
import street_suffix from './street_suffix';
Expand All @@ -26,6 +27,7 @@ const location: LocationDefinition = {
postcode,
secondary_address,
state,
state_abbr,
street_address,
street_pattern,
street_suffix,
Expand Down
16 changes: 8 additions & 8 deletions src/locales/nl/location/state.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default [
'Noord-Holland',
'Zuid-Holland',
'Utrecht',
'Zeeland',
'Overijssel',
'Gelderland',
'Drenthe',
'Flevoland',
'Friesland',
'Gelderland',
'Groningen',
'Noord-Brabant',
'Limburg',
'Flevoland',
'Noord-Brabant',
'Noord-Holland',
'Overijssel',
'Utrecht',
'Zeeland',
'Zuid-Holland',
];
14 changes: 14 additions & 0 deletions src/locales/nl/location/state_abbr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default [
'DR',
'FL',
'FR',
'GE',
'GR',
'LI',
'NB',
'NH',
'OV',
'UT',
'ZE',
'ZH',
];
2 changes: 1 addition & 1 deletion src/modules/color/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class ColorModule {
}

/**
* Returns a random human readable color name.
* Returns a random human-readable color name.
*
* @example
* faker.color.human() // 'red'
Expand Down
2 changes: 1 addition & 1 deletion src/modules/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { deprecated } from '../../internal/deprecated';

/**
* Converts date passed as a string, number or Date to a Date object.
* If nothing or a non parsable value is passed, then it will take the value from the given fallback.
* If nothing or a non-parsable value is passed, then it will take the value from the given fallback.
*
* @param date The date to convert.
* @param fallback The fallback date to use if the passed date is not valid.
Expand Down
14 changes: 7 additions & 7 deletions src/modules/finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ export class FinanceModule {
/**
* Generates a random credit card number.
*
* @param issuer The name of the issuer (case insensitive) or the format used to generate one.
* @param issuer The name of the issuer (case-insensitive) or the format used to generate one.
*
* @example
* faker.finance.creditCardNumber() // '4427163488662'
Expand All @@ -754,7 +754,7 @@ export class FinanceModule {
* Generates a random credit card number.
*
* @param options An options object. Defaults to `''`.
* @param options.issuer The name of the issuer (case insensitive) or the format used to generate one.
* @param options.issuer The name of the issuer (case-insensitive) or the format used to generate one.
*
* @example
* faker.finance.creditCardNumber() // '4427163488662'
Expand All @@ -765,7 +765,7 @@ export class FinanceModule {
*/
creditCardNumber(options?: {
/**
* The name of the issuer (case insensitive) or the format used to generate one.
* The name of the issuer (case-insensitive) or the format used to generate one.
*
* @default ''
*/
Expand All @@ -775,7 +775,7 @@ export class FinanceModule {
* Generates a random credit card number.
*
* @param options An options object, the issuer or a custom format. Defaults to `{}`.
* @param options.issuer The name of the issuer (case insensitive) or the format used to generate one.
* @param options.issuer The name of the issuer (case-insensitive) or the format used to generate one.
*
* @example
* faker.finance.creditCardNumber() // '4427163488662'
Expand All @@ -790,7 +790,7 @@ export class FinanceModule {
| string
| {
/**
* The name of the issuer (case insensitive) or the format used to generate one.
* The name of the issuer (case-insensitive) or the format used to generate one.
*
* @default ''
*/
Expand All @@ -801,7 +801,7 @@ export class FinanceModule {
* Generates a random credit card number.
*
* @param options An options object, the issuer or a custom format. Defaults to `{}`.
* @param options.issuer The name of the issuer (case insensitive) or the format used to generate one.
* @param options.issuer The name of the issuer (case-insensitive) or the format used to generate one.
*
* @example
* faker.finance.creditCardNumber() // '4427163488662'
Expand All @@ -816,7 +816,7 @@ export class FinanceModule {
| string
| {
/**
* The name of the issuer (case insensitive) or the format used to generate one.
* The name of the issuer (case-insensitive) or the format used to generate one.
*
* @default ''
*/
Expand Down
4 changes: 2 additions & 2 deletions src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class HelpersModule {
* - `.{min,max}` => Repeat the character `min` to `max` times.
* - `[min-max]` => Generate a number between min and max (inclusive).
*
* @param string The template string to to parse.
* @param string The template string to parse.
*
* @example
* faker.helpers.regexpStyleStringParse() // ''
Expand Down Expand Up @@ -355,7 +355,7 @@ export class HelpersModule {
* - `[x-y]+` => Repeat characters between `x` and `y` (inclusive) 1 or more times.
* - `.` => returns a wildcard ASCII character that can be any number, character or symbol. Can be combined with quantifiers as well.
*
* @param pattern The template string/RegExp to to generate a matching string for.
* @param pattern The template string/RegExp to generate a matching string for.
*
* @throws If min value is more than max value in quantifier. e.g. `#{10,5}`
* @throws If invalid quantifier symbol is passed in.
Expand Down
20 changes: 10 additions & 10 deletions src/modules/internet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ export class InternetModule {

/**
* Generates a username using the given person's name as base.
* The resuling username may use neither, one or both of the names provided.
* The resulting username may use neither, one or both of the names provided.
* This will always return a plain ASCII string.
* Some basic stripping of accents and transliteration of characters will be done.
*
Expand Down Expand Up @@ -522,7 +522,7 @@ export class InternetModule {
}): string;
/**
* Generates a username using the given person's name as base.
* The resuling username may use neither, one or both of the names provided.
* The resulting username may use neither, one or both of the names provided.
* This will always return a plain ASCII string.
* Some basic stripping of accents and transliteration of characters will be done.
*
Expand All @@ -546,7 +546,7 @@ export class InternetModule {
userName(firstName?: string, lastName?: string): string;
/**
* Generates a username using the given person's name as base.
* The resuling username may use neither, one or both of the names provided.
* The resulting username may use neither, one or both of the names provided.
* This will always return a plain ASCII string.
* Some basic stripping of accents and transliteration of characters will be done.
*
Expand Down Expand Up @@ -1309,7 +1309,7 @@ export class InternetModule {
* @param options An options object. Defaults to `{}`.
* @param options.length The length of the password to generate. Defaults to `15`.
* @param options.memorable Whether the generated password should be memorable. Defaults to `false`.
* @param options.pattern The pattern that all chars should match should match.
* @param options.pattern The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`. Defaults to `/\w/`.
* @param options.prefix The prefix to use. Defaults to `''`.
*
Expand All @@ -1336,7 +1336,7 @@ export class InternetModule {
*/
memorable?: boolean;
/**
* The pattern that all chars should match should match.
* The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`.
*
* @default /\w/
Expand All @@ -1354,7 +1354,7 @@ export class InternetModule {
*
* @param len The length of the password to generate. Defaults to `15`.
* @param memorable Whether the generated password should be memorable. Defaults to `false`.
* @param pattern The pattern that all chars should match should match.
* @param pattern The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`. Defaults to `/\w/`.
* @param prefix The prefix to use. Defaults to `''`.
*
Expand All @@ -1381,11 +1381,11 @@ export class InternetModule {
* @param options The length of the password or an options object. Defaults to `{}`.
* @param options.length The length of the password to generate. Defaults to `15`.
* @param options.memorable Whether the generated password should be memorable. Defaults to `false`.
* @param options.pattern The pattern that all chars should match should match.
* @param options.pattern The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`. Defaults to `/\w/`.
* @param options.prefix The prefix to use. Defaults to `''`.
* @param legacyMemorable Whether the generated password should be memorable. Defaults to `false`.
* @param legacyPattern The pattern that all chars should match should match.
* @param legacyPattern The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`. Defaults to `/\w/`.
* @param legacyPrefix The prefix to use. Defaults to `''`.
*
Expand Down Expand Up @@ -1415,7 +1415,7 @@ export class InternetModule {
*/
memorable?: boolean;
/**
* The pattern that all chars should match should match.
* The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`.
*
* @default /\w/
Expand Down Expand Up @@ -1449,7 +1449,7 @@ export class InternetModule {
*/
memorable?: boolean;
/**
* The pattern that all chars should match should match.
* The pattern that all chars should match.
* This option will be ignored, if `memorable` is `true`.
*
* @default /\w/
Expand Down
20 changes: 10 additions & 10 deletions src/modules/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export class LocationModule {
* Generates random zip code from specified format. If format is not specified,
* the locale's zip format is used.
*
* @param options The format used to generate the the zip code or an options object. Defaults to `{}`.
* @param options The format used to generate the zip code or an options object. Defaults to `{}`.
* @param options.state The state to generate the zip code for.
* If the current locale does not have a corresponding `postcode_by_state` definition, an error is thrown.
* @param options.format The optional format used to generate the the zip code.
* @param options.format The optional format used to generate the zip code.
* By default, a random format is used from the locale zip formats.
* This wont be used if the state option is specified.
* This won't be used if the state option is specified.
*
* @see faker.helpers.replaceSymbols()
*
Expand All @@ -53,13 +53,13 @@ export class LocationModule {
/**
* The state to generate the zip code for.
*
* If the currrent locale does not have a corresponding `postcode_by_state` definition, an error is thrown.
* If the current locale does not have a corresponding `postcode_by_state` definition, an error is thrown.
*/
state?: string;
/**
* The optional format used to generate the the zip code.
* The optional format used to generate the zip code.
*
* This wont be used if the state option is specified.
* This won't be used if the state option is specified.
*
* @default faker.definitions.location.postcode
*/
Expand Down Expand Up @@ -327,8 +327,8 @@ export class LocationModule {
* Returns a random [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code.
*
* @param options The code to return or an options object. Defaults to `{}`.
* @param options.variant The variant to return. Can be either `'alpha-2'` (two letter code)
* or `'alpha-3'` (three letter code). Defaults to `'alpha-2'`.
* @param options.variant The variant to return. Can be either `'alpha-2'` (two-letter code)
* or `'alpha-3'` (three-letter code). Defaults to `'alpha-2'`.
*
* @example
* faker.location.countryCode() // 'SJ'
Expand All @@ -344,8 +344,8 @@ export class LocationModule {
| {
/**
* The code to return.
* Can be either `'alpha-2'` (two letter code)
* or `'alpha-3'` (three letter code).
* Can be either `'alpha-2'` (two-letter code)
* or `'alpha-3'` (three-letter code).
*
* @default 'alpha-2'
*/
Expand Down

0 comments on commit 1e105c7

Please sign in to comment.