is-copy.js 622 B

123456789101112131415
  1. "use strict";
  2. module.exports = function (t, a) {
  3. a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
  4. a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, "Different property value");
  5. a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, "Property only in source");
  6. a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, "Property only in target");
  7. a(t("raz", "dwa"), false, "String: diff");
  8. a(t("raz", "raz"), true, "String: same");
  9. a(t("32", 32), false, "String & Number");
  10. a(t([1, "raz", true], [1, "raz", true]), true, "Array: same");
  11. a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff");
  12. };