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:
{}
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 seemargin-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:{}