We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71102d4 commit f32d228Copy full SHA for f32d228
src/lib/isAfter.js
@@ -4,18 +4,9 @@ import toDate from './toDate';
4
export default function isAfter(str, options) {
5
assertString(str);
6
7
- let date;
8
-
9
- if (typeof (options) === 'object') {
10
- date = options.date;
11
- } else { // backwards compatibility: isAfter(str [, date])
12
- // eslint-disable-next-line prefer-rest-params
13
- date = arguments[1];
14
- }
15
16
- if (!date) {
17
- date = String(new Date());
18
+ // accessing 'arguments' for backwards compatibility: isAfter(str [, date])
+ // eslint-disable-next-line prefer-rest-params
+ const date = (typeof options === 'object' ? options.date : arguments[1]) || String(new Date());
19
20
const comparison = toDate(date);
21
const original = toDate(str);
0 commit comments