diff options
| author | ST-DDT <[email protected]> | 2024-02-05 09:39:09 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-05 08:39:09 +0000 |
| commit | acba5b7dd864ee51bc5dbc6861a2d5f3219ed5b2 (patch) | |
| tree | 5d0cd07d093535a20a0781939848b2c92dba98c3 /src | |
| parent | acbdae73347aa9cafb253c7c51b677ca762da9c4 (diff) | |
| download | faker-acba5b7dd864ee51bc5dbc6861a2d5f3219ed5b2.tar.xz faker-acba5b7dd864ee51bc5dbc6861a2d5f3219ed5b2.zip | |
docs: missing options jsdocs (#2638)
Diffstat (limited to 'src')
| -rw-r--r-- | src/faker.ts | 19 | ||||
| -rw-r--r-- | src/modules/finance/index.ts | 15 | ||||
| -rw-r--r-- | src/modules/number/index.ts | 4 | ||||
| -rw-r--r-- | src/simple-faker.ts | 2 |
4 files changed, 38 insertions, 2 deletions
diff --git a/src/faker.ts b/src/faker.ts index 97a513d0..e63b89b3 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -183,8 +183,27 @@ export class Faker extends SimpleFaker { * @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead. */ constructor(options: { + /** + * The locale data to use for this instance. + * + * @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead. + */ locales: Record<string, LocaleDefinition>; + /** + * The name of the main locale to use. + * + * @default 'en' + * + * @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead. + */ locale?: string; + /** + * The name of the fallback locale to use. + * + * @default 'en' + * + * @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead. + */ localeFallback?: string; }); // This is somehow required for `ConstructorParameters<typeof Faker>[0]` to work diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 111db571..f7a84f74 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -271,8 +271,23 @@ export class FinanceModule extends ModuleBase { * @since 8.0.0 */ maskedNumber(options?: { + /** + * The length of the unmasked number. + * + * @default 4 + */ length?: number; + /** + * Whether to use surrounding parenthesis. + * + * @default true + */ parens?: boolean; + /** + * Whether to prefix the numbers with an ellipsis. + * + * @default true + */ ellipsis?: boolean; }): string; /** diff --git a/src/modules/number/index.ts b/src/modules/number/index.ts index b4137cce..9e9eb4ed 100644 --- a/src/modules/number/index.ts +++ b/src/modules/number/index.ts @@ -134,7 +134,7 @@ export class NumberModule extends SimpleModuleBase { * The maximum number of digits to appear after the decimal point, for example `2` will round to 2 decimal points. Only one of `multipleOf`, `precision` or `fractionDigits` should be passed. */ fractionDigits?: number; - /* + /** * Deprecated alias for `multipleOf`. Only one of `multipleOf`, `precision` or `fractionDigits` should be passed. * * @deprecated Use `multipleOf` instead. @@ -156,7 +156,9 @@ export class NumberModule extends SimpleModuleBase { min = 0, max = 1, fractionDigits, + // eslint-disable-next-line deprecation/deprecation precision, + // eslint-disable-next-line deprecation/deprecation multipleOf: originalMultipleOf = precision, multipleOf = precision ?? (fractionDigits == null ? undefined : 10 ** -fractionDigits), diff --git a/src/simple-faker.ts b/src/simple-faker.ts index 4dd755e1..3993392d 100644 --- a/src/simple-faker.ts +++ b/src/simple-faker.ts @@ -105,7 +105,7 @@ export class SimpleFaker { * // create a SimpleFaker without any locale data * const customSimpleFaker = new SimpleFaker(); * - * customSimpleFaker.helpers.arrayElement([red', 'green', 'blue']); // 'green' + * customSimpleFaker.helpers.arrayElement(['red', 'green', 'blue']); // 'green' * customSimpleFaker.number.int(10); // 4 * * @since 8.1.0 |
