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

refactor: drop lodash for new-post-path filter #3813

Merged
merged 2 commits into from
Nov 2, 2019

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Oct 27, 2019

What does it do?

This PR is part of #3753

How to test

git clone -b drop-lodash-for-new-post-path https://github.com/sukkaw/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@SukkaW SukkaW requested a review from curbengh October 27, 2019 14:59
@SukkaW SukkaW requested a review from segayuu October 29, 2019 00:23
yoshinorin
yoshinorin previously approved these changes Oct 29, 2019
Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

Sorry, it's wrong. Please do not merge yet.

if permalink_defaults is null exctption occure.

TypeError: Cannot convert undefined or null to object

@yoshinorin yoshinorin dismissed their stale review October 29, 2019 11:27

I accidentally approved it.

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

I think we should set the default value at new_post_path.js#L26.

const permalinkDefaults = config.permalink_defaults || '';

@SukkaW
Copy link
Member Author

SukkaW commented Oct 29, 2019

@yoshinorin

Maybe Object.assign({}, permalinkDefaults, filenameData) should be used? Then null will be ignored.

@yoshinorin
Copy link
Member

Maybe Object.assign({}, permalinkDefaults, filenameData) should be used?

I think it's better than set default value :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.169% when pulling 330d88b on SukkaW:drop-lodash-for-new-post-path into c48f6a8 on hexojs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 97.169% when pulling 330d88b on SukkaW:drop-lodash-for-new-post-path into c48f6a8 on hexojs:master.

@SukkaW SukkaW merged commit 0e59184 into hexojs:master Nov 2, 2019
thom4parisot pushed a commit to thom4parisot/hexo that referenced this pull request Jan 17, 2020
* refactor: drop lodash for new-post-path filter
* fix: handle null case for new-post-path filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants