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

feat: support less each function #127

Merged
merged 1 commit into from Nov 14, 2018

Conversation

Projects
None yet
3 participants
@shellscape
Owner

shellscape commented Nov 14, 2018

Which issue # if any, does this resolve?

Please check one:

  • New tests created for this change
  • Tests updated for this change

This PR:

  • Adds new API
  • Extends existing API, backwards-compatible
  • Introduces a breaking change
  • Fixes a bug

This PR fixes #121 by adding relatively naive support for the new each function in LESS. each is relatively unique, as it's the only function used at the root level, outside of a ruleset. While this change doesn't do anything special with the params, it allows the parser to continue on without throwing an error.

The result is an AtRule with a function: true property, and params property which contains everything between the first and last, open and closed parenthesis.

In the future we might examine how to parse and present the params for each in the node.

@shellscape shellscape requested a review from jwilsson Nov 14, 2018

@codecov-io

This comment has been minimized.

codecov-io commented Nov 14, 2018

Codecov Report

Merging #127 into master will increase coverage by 0.35%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   95.74%   96.09%   +0.35%     
==========================================
  Files           8        8              
  Lines         188      205      +17     
==========================================
+ Hits          180      197      +17     
  Misses          8        8
Impacted Files Coverage Δ
lib/LessStringifier.js 87.5% <100%> (+0.54%) ⬆️
lib/LessParser.js 98.92% <100%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9392246...adca450. Read the comment docs.

@jwilsson

I like this idea, putting everything into params, better too. I'd argue that everything are parameters and parsing that should be easy enough if someone wants to parse it further.

Code LGTM too.

@shellscape shellscape merged commit e3731c3 into master Nov 14, 2018

8 checks passed

ci/circleci: analysis Your tests passed on CircleCI!
Details
ci/circleci: dependency_cache Your tests passed on CircleCI!
Details
ci/circleci: node-v10-latest Your tests passed on CircleCI!
Details
ci/circleci: node-v6-latest Your tests passed on CircleCI!
Details
ci/circleci: node-v8-latest Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 95.74%)
Details
codecov/project 96.09% (+0.35%) compared to 9392246
Details
security/snyk - package.json (shellscape) No manifest changes detected

@shellscape shellscape deleted the feat/each branch Nov 14, 2018

@shellscape

This comment has been minimized.

Owner

shellscape commented Nov 14, 2018

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment