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

Leverage lodash to simplify the logic. #103

Merged
merged 6 commits into from
Feb 27, 2016
Merged

Conversation

lijunle
Copy link
Member

@lijunle lijunle commented Feb 26, 2016

  • Install back lodash package.
  • Widely use lodash to simplify the implementation.
  • Refine some code logic.

@lijunle lijunle added this to the 0.7.1 milestone Feb 26, 2016
@lijunle lijunle modified the milestones: 0.6.1, 0.7.1 Feb 26, 2016
@codecov-io
Copy link

Current coverage is 97.55%

Merging #103 into master will decrease coverage by -0.51% as of 63aec88

@@            master    #103   diff @@
======================================
  Files           16      16       
  Stmts          362     327    -35
  Branches        81      74     -7
  Methods          0       0       
======================================
- Hit            355     319    -36
  Partial          5       5       
- Missed           2       3     +1

Review entire Coverage Diff as of 63aec88

Powered by Codecov. Updated on successful CI builds.

function concat(array, item) {
return array.concat(item);
}

function isStringArray(obj) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Leveage lodash to simplify this function too.

@lijunle lijunle force-pushed the lodash branch 3 times, most recently from e22b1fa to a3b4ebb Compare February 27, 2016 11:44
- Use `toPairs` and `fromPairs` to avoid some complex reduce call.
- Use `partial` to avoid similar function calls.
- Use `intersection` to avoid filter+indexOf combine call.
- Use `flatten` to avoid some strange spread syntax codes.
- Use `first` to avoid access the array directly.
- Use `uniq` to replace `unique` reduce call.

WTF.
- Make more meaningful functions.
- Make less functions.
- Leverage lodash to simplify the operations.
@lijunle lijunle force-pushed the lodash branch 3 times, most recently from 3d74d71 to b1d32a0 Compare February 27, 2016 11:58
- Use one if-else branch statement.
- Workaround the weak set issue in node.js <= 3.
- It needs a `type` property on AST object.
lijunle added a commit that referenced this pull request Feb 27, 2016
Leverage lodash to simplify the logic.
@lijunle lijunle merged commit ec643b3 into depcheck:master Feb 27, 2016
@lijunle lijunle deleted the lodash branch February 27, 2016 12:35
nigelzor pushed a commit to nigelzor/depcheck that referenced this pull request Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants