compact.js 351 B

123456789101112
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var x = {}, y = {}, z;
  4. z = t(x);
  5. a.not(z, x, "Returns different object");
  6. a.deep(z, {}, "Empty on empty");
  7. x = { foo: "bar", a: 0, b: false, c: "", d: "0", e: null, bar: y, elo: undefined };
  8. z = t(x);
  9. a.deep(z, { foo: "bar", a: 0, b: false, c: "", d: "0", bar: y }, "Cleared null values");
  10. };