-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: improve support for each #103
base: main
Are you sure you want to change the base?
Conversation
@@ -38,7 +38,7 @@ export default function getValueAsObject(value) { | |||
const matchWrappingParens = /^\(([\W\w]*)\)$/g; | |||
|
|||
// match a property name (any-possible_name) | |||
const matchDeclaration = /^([\w-]+)\s*:\s*([\W\w]+)\s*$/; | |||
const matchDeclaration = /^["']?([\w-]+)["']?\s*:\s*([\W\w]+)\s*$/; |
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.
quoted keys where not supported
@@ -55,7 +55,7 @@ export default function transformEachAtrule(rule, opts) { | |||
// return the @each statement options (@each NAME in LIST, @each NAME ITERATOR in LIST) | |||
const getEachOpts = (node, opts) => { | |||
const params = node.params.split(matchInOperator); | |||
const args = (params[0] || '').trim().split(' '); | |||
const args = (params[0] || '').trim().split(/[\s,]+/); |
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.
@each $value, $key in $arrayTest {
support for sass syntax -> comma
const reverseParams = incname && !Array.isArray(list) | ||
if (reverseParams) { | ||
return { incname: varname, varname: incname, list }; | ||
} |
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.
in case of object if 2 arguments are passed, its key, value
."1"-arrayTest { | ||
content: "1"; | ||
} | ||
."2"-arrayTest { |
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 idffers from sass, as sass removes "', not sure if you want me to remove it to
removal of quotes is only present if string is \w_
from what i observed
f561999
to
5b7ae89
Compare
@Nunnius for time beeing this and few other fixes are released as |
Do you plan to update the README.md of your project to explain it’s a fork, and that it can be downloaded from |
Adds missing tests and improves support to
@each object
fixes #88, fixes #91, fixes #59