Skip to content

Commit

Permalink
fix: throw error on invalid date
Browse files Browse the repository at this point in the history
  • Loading branch information
luciferreeves committed Jan 17, 2022
1 parent 844f0bd commit 652f568
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/browser/js/faker.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/browser/js/faker.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/zodiac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export class Zodiac {
return this.faker.definitions.zodiac.sign[10];
} else if ((month === 12 && day > 21) || (month === 1 && day <= 20)) {
return this.faker.definitions.zodiac.sign[11];
} else {
throw new Error('Invalid date');
}
}
}
Expand Down

0 comments on commit 652f568

Please sign in to comment.