You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've found an issue and wondering if you can point me in the right direction.
Say for example you do something like this: var rules = $.stylesheet('.selector', {margin-top, padding-top, padding-bottom});
And do a dump of rules, if the selector did not have values set for any of the passed in css attributes, then those fields will be blank. Eg: console.log(rules);
then you'll see margin-top:'undefined', padding-top:'undefined', padding-bottom:'undefined',
It's not a huge deal, but it means if you're concerned about clean code, then you have to iterate through the object and do a type check/remove undefined fields. So what I'm wondering, is where I'd need to look in the script to fix this issue. The desired result would be to not have the fields returned in the object if they have no value. Eg the above example would result in: {}
The text was updated successfully, but these errors were encountered:
So I've found an issue and wondering if you can point me in the right direction.
Say for example you do something like this:
var rules = $.stylesheet('.selector', {margin-top, padding-top, padding-bottom});
And do a dump of rules, if the selector did not have values set for any of the passed in css attributes, then those fields will be blank. Eg:
console.log(rules);
then you'll see
margin-top:'undefined', padding-top:'undefined', padding-bottom:'undefined',
It's not a huge deal, but it means if you're concerned about clean code, then you have to iterate through the object and do a type check/remove undefined fields. So what I'm wondering, is where I'd need to look in the script to fix this issue. The desired result would be to not have the fields returned in the object if they have no value. Eg the above example would result in:
{}
The text was updated successfully, but these errors were encountered: