diff options
| author | DivisionByZero <[email protected]> | 2023-02-19 20:40:28 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-19 20:40:28 +0100 |
| commit | 54faf53b47827d800872847c4075e496a8c9942b (patch) | |
| tree | d7ce7b595dd128383f4681ed499116c0b2ee6ca3 /src/modules | |
| parent | fccd641f02fc0db463d34e1a7cc459ad6bd0b265 (diff) | |
| download | faker-54faf53b47827d800872847c4075e496a8c9942b.tar.xz faker-54faf53b47827d800872847c4075e496a8c9942b.zip | |
refactor(datatype): deprecate `array` (#1853)
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/datatype/index.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/datatype/index.ts b/src/modules/datatype/index.ts index bf07cfd5..6a03362f 100644 --- a/src/modules/datatype/index.ts +++ b/src/modules/datatype/index.ts @@ -419,6 +419,8 @@ export class DatatypeModule { * faker.datatype.array({ min: 3, max: 5 }) // [ 99403, 76924, 42281, "Q'|$&y\\G/9" ] * * @since 5.5.0 + * + * @deprecated Use your own function to build complex arrays. */ array( length: @@ -434,6 +436,13 @@ export class DatatypeModule { max: number; } = 10 ): Array<string | number> { + deprecated({ + deprecated: 'faker.datatype.array()', + proposed: 'your own function to build complex arrays', + since: '8.0', + until: '9.0', + }); + return this.faker.helpers.multiple( () => this.boolean() ? this.faker.string.sample() : this.faker.number.int(), |
