Skip to content

Commit

Permalink
chore: align coding style of deprecated.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Dec 3, 2024
1 parent ecb5cb4 commit 5d4ff8c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/internal/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d4ff8c

Please sign in to comment.