diff options
| author | Shinigami <[email protected]> | 2025-07-04 20:23:30 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-04 18:23:30 +0000 |
| commit | 623d2741a4ca165596fad7fede2f850b6c08aa3a (patch) | |
| tree | c05531e1f25bea9201925c0342d22e9a50f8946f /src/modules/date | |
| parent | 160960b79719e1298668a7ebba390b30b8de1080 (diff) | |
| download | faker-623d2741a4ca165596fad7fede2f850b6c08aa3a.tar.xz faker-623d2741a4ca165596fad7fede2f850b6c08aa3a.zip | |
refactor!: remove deprecations (#3553)
Diffstat (limited to 'src/modules/date')
| -rw-r--r-- | src/modules/date/index.ts | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/modules/date/index.ts b/src/modules/date/index.ts index 65d4a7d9..f1225cdb 100644 --- a/src/modules/date/index.ts +++ b/src/modules/date/index.ts @@ -160,13 +160,6 @@ export class SimpleDateModule extends SimpleModuleBase { */ to: string | Date | number; }): Date { - // TODO @matthewmayer 2023-03-27: Consider removing in v10 as this check is only needed in JS - if (options == null || options.from == null || options.to == null) { - throw new FakerError( - 'Must pass an options object with `from` and `to` values.' - ); - } - const { from, to } = options; const fromMs = toDate(from, 'from').getTime(); @@ -234,13 +227,6 @@ export class SimpleDateModule extends SimpleModuleBase { max: number; }; }): Date[] { - // TODO @matthewmayer 2023-03-27: Consider removing in v10 as this check is only needed in JS - if (options == null || options.from == null || options.to == null) { - throw new FakerError( - 'Must pass an options object with `from` and `to` values.' - ); - } - const { from, to, count = 3 } = options; return this.faker.helpers .multiple(() => this.between({ from, to }), { count }) @@ -486,21 +472,8 @@ export class SimpleDateModule extends SimpleModuleBase { min = 18, max = 80, refDate: rawRefDate = this.faker.defaultRefDate(), - mode: originalMode, - min: originalMin, - max: originalMax, } = options; - // TODO @ST-DDT 2024-03-17: Remove check in v10 - const optionsSet = [originalMin, originalMax, originalMode].filter( - (x) => x != null - ).length; - if (optionsSet % 3 !== 0) { - throw new FakerError( - "The 'min', 'max', and 'mode' options must be set together." - ); - } - const refDate = toDate(rawRefDate); const refYear = refDate.getUTCFullYear(); |
