-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Reduce lodash dependent code #3285
Reduce lodash dependent code #3285
Conversation
1 similar comment
@@ -2,7 +2,7 @@ | |||
|
|||
const moment = require('moment-timezone'); | |||
const isMoment = moment.isMoment; | |||
const isDate = require('lodash').isDate; | |||
const isDate = require('lodash/isDate'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think lodash/isDate
maybe can replace instanceof Date
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right!
In addition, lodash.isDate()
returns the result if util.types.isDate()
exists, if one exists.
Although it may be corrected, I think that the necessity to thoroughly perform the contents of this PR is thinner than other libraries such as warehouse
.
That's because hexo
exports the lodash
namespace and it's a big size as a library.
@segayuu
It seems works well. I think this PR is no problem. |
OK, Merged ! |
thank @yoshinorin ! |
Thank you for creating a pull request to contribute to Hexo code! Before you open the request please review the following guidelines and tips to help it be more easily integrated: