diff options
| author | Shinigami <[email protected]> | 2022-05-04 11:48:03 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-04 11:48:03 +0200 |
| commit | 683ee3405c39408d74d74cac0755a26de7a99e35 (patch) | |
| tree | 30a51b3fe3bf1013149045777f84e0d8de9724c5 /src/modules/unique | |
| parent | 100a1ea230cba422174a6b5103c56bc4cf9c0dc4 (diff) | |
| download | faker-683ee3405c39408d74d74cac0755a26de7a99e35.tar.xz faker-683ee3405c39408d74d74cac0755a26de7a99e35.zip | |
refactor!: remove deprecations (#916)
Diffstat (limited to 'src/modules/unique')
| -rw-r--r-- | src/modules/unique/index.ts | 77 |
1 files changed, 1 insertions, 76 deletions
diff --git a/src/modules/unique/index.ts b/src/modules/unique/index.ts index 798fc29e..d77004e4 100644 --- a/src/modules/unique/index.ts +++ b/src/modules/unique/index.ts @@ -1,4 +1,3 @@ -import { deprecated } from '../../internal/deprecated'; import type { RecordKey } from './unique'; import * as uniqueExec from './unique'; @@ -6,80 +5,6 @@ import * as uniqueExec from './unique'; * Module to generate unique entries. */ export class Unique { - /** - * Maximum time `unique.exec` will attempt to run before aborting. - * - * @deprecated Use options instead. - */ - private _maxTime = 10; - - /** - * Maximum time `unique.exec` will attempt to run before aborting. - * - * @deprecated Use options instead. - */ - get maxTime(): number { - deprecated({ - deprecated: 'faker.unique.maxTime', - proposed: 'Options', - since: 'v6.2.0', - until: 'v7.0.0', - }); - return this._maxTime; - } - - /** - * Maximum time `unique.exec` will attempt to run before aborting. - * - * @deprecated Use options instead. - */ - set maxTime(value: number) { - deprecated({ - deprecated: 'faker.unique.maxTime', - proposed: 'Options', - since: 'v6.2.0', - until: 'v7.0.0', - }); - this._maxTime = value; - } - - /** - * Maximum retries `unique.exec` will recurse before aborting (max loop depth). - * - * @deprecated Use options instead. - */ - private _maxRetries = 10; - - /** - * Maximum retries `unique.exec` will recurse before aborting (max loop depth). - * - * @deprecated Use options instead. - */ - get maxRetries(): number { - deprecated({ - deprecated: 'faker.unique.maxRetries', - proposed: 'Options', - since: 'v6.2.0', - until: 'v7.0.0', - }); - return this._maxRetries; - } - - /** - * Maximum retries `unique.exec` will recurse before aborting (max loop depth). - * - * @deprecated Use options instead. - */ - set maxRetries(value: number) { - deprecated({ - deprecated: 'faker.unique.maxRetries', - proposed: 'Options', - since: 'v6.2.0', - until: 'v7.0.0', - }); - this._maxRetries = value; - } - constructor() { // Bind `this` so namespaced is working correctly for (const name of Object.getOwnPropertyNames(Unique.prototype)) { @@ -127,7 +52,7 @@ export class Unique { store?: Record<RecordKey, RecordKey>; } = {} ): ReturnType<Method> { - const { maxTime = this._maxTime, maxRetries = this._maxRetries } = options; + const { maxTime = 50, maxRetries = 50 } = options; return uniqueExec.exec(method, args, { ...options, startTime: new Date().getTime(), |
