compact.js 355 B

1234567891011121314151617181920
  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",
  8. a: 0,
  9. b: false,
  10. c: "",
  11. d: "0",
  12. e: null,
  13. bar: y,
  14. elo: undefined };
  15. z = t(x);
  16. a.deep(z, { foo: "bar", a: 0, b: false, c: "", d: "0", bar: y },
  17. "Cleared null values");
  18. };