-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fixed @left-*
parsing
#342
Conversation
Pull Request Test Coverage Report for Build 12736556494Details
💛 - Coveralls |
if (charat(characters, 3) === 110) break | ||
// l(ayer) | ||
case 108: | ||
if (charat(characters, 2) === 97) break | ||
default: |
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.
this is a default case that's not the last one 😅 I tried to code-golf this as much as possible and this is my best version so far
I was testing the size increase on dist/umd/stylis.js
(since it's already minified) using wc -c
and gzip -c | wc -c
. Those are results:
ref | wc -c | gzip -c | wc -c |
---|---|---|
master | 10571 | 4396 |
9c57efb | 10607 | 4413 |
2a519d3 | 10619 | 4409 |
ebd509a | 10606 | 4406 |
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.
The idea behind the fix here is that for non-layer and non-container (this case was already covered) we "reset" offset
. We do the same in the default case and that's why the code falls through from those when it doesn't break
Then based on the offset
(if it survived or not) the correct parsing invocation is selected
fixes #341