yola/plom — pull request #3 by AhoyM (2014-09-30 18:36:52+00:00)
Title: Enable boolean values for keys

Fixes https://github.com/yola/plom/issues/2

If a user wanted to set a key to have the boolean false value, it would not work as expected due to the conditional logic.

Plom.prototype.set = function(key, val) {
if(val) {
this.data[key] = val;
return this;
}

this.data = key;
return this;
};

`val` would be false, it would skip setting that key to false, and instead set the entire data object to the input key name. By checking if the value is not `undefined`, the conditional now correctly determines if there is a `val` or not.