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: native Array.flat() #4806

Merged
merged 1 commit into from
Oct 25, 2021
Merged

refactor: native Array.flat() #4806

merged 1 commit into from
Oct 25, 2021

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Oct 24, 2021

What does it do?

const arr = [1,2,3,[4,[5,6]]
const flatten = arr.flat()
// [1,2,3,4,[5,6]

const flatten = arr.flat(Infinity)
// [1, 2, 3, 4, 5, 6]

How to test

git clone -b array-flat https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
    • Existing test case already covered.
  • Passed the CI test.
    • Both files still retain 100% coverage.

- Node 12 feature
- remove misleading "old syntax"
  * "old syntax" implies deprecation,
    but in this case, it's just different syntax
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 98.119% when pulling e42143f on curbengh:array-flat into ed0f239 on hexojs:master.

Copy link
Member

@jiangtj jiangtj left a comment

Choose a reason for hiding this comment

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

👍

@SukkaW SukkaW merged commit 0c6380c into hexojs:master Oct 25, 2021
@stevenjoezhang stevenjoezhang mentioned this pull request Mar 28, 2022
2 tasks
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.

None yet

4 participants