Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade date-fns to v3 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"dependencies": {
"@babel/runtime": "^7.6.2",
"date-fns": "^2.0.0"
"date-fns": "^3.6.0"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider that a breaking change if you care about IE support.

},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js"
Expand Down
14 changes: 8 additions & 6 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import addDays from 'date-fns/addDays';
import isBefore from 'date-fns/isBefore';
import isToday from 'date-fns/isToday';
import startOfDay from 'date-fns/startOfDay';
import differenceInCalendarMonths from 'date-fns/differenceInCalendarMonths';
import { addDays } from 'date-fns/addDays';
import { isBefore } from 'date-fns/isBefore';
import { isToday } from 'date-fns/isToday';
import { startOfDay } from 'date-fns/startOfDay';
import { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths';

/**
* This is intended to be used to compose event handlers
Expand All @@ -15,7 +15,9 @@ import differenceInCalendarMonths from 'date-fns/differenceInCalendarMonths';
export function composeEventHandlers(...fns) {
return (event, ...args) =>
fns.some(fn => {
fn && fn(event, ...args);
if (fn) {
fn(event, ...args);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this project has no lock file.
It looks like that some lint rules have changed.

✖ kcd-scripts lint found some errors. Please fix them and try committing again.

/Users/andy/work/js/dayzed/src/utils.js
  18:7  error  Expected an assignment or function call and instead saw an expression  babel/no-unused-expressions

✖ 1 problem (1 error, 0 warnings)

return event.defaultPrevented;
});
}
Expand Down