diff --git a/src/internal/deprecated.ts b/src/internal/deprecated.ts index 3d82eb2e2ef..3ac036daa83 100644 --- a/src/internal/deprecated.ts +++ b/src/internal/deprecated.ts @@ -28,19 +28,20 @@ export interface DeprecatedOptions { /** * @internal */ -export function deprecated(opts: DeprecatedOptions): void { - let message = `[@faker-js/faker]: ${opts.deprecated} is deprecated`; +export function deprecated(options: DeprecatedOptions): void { + const { deprecated, since, until, proposed } = options; + let message = `[@faker-js/faker]: ${deprecated} is deprecated`; - if (opts.since) { - message += ` since v${opts.since}`; + if (since) { + message += ` since v${since}`; } - if (opts.until) { - message += ` and will be removed in v${opts.until}`; + if (until) { + message += ` and will be removed in v${until}`; } - if (opts.proposed) { - message += `. Please use ${opts.proposed} instead`; + if (proposed) { + message += `. Please use ${proposed} instead`; } // eslint-disable-next-line no-undef -- Using console here is intentional and required