This commit is contained in:
Simon Priet
2021-09-05 22:53:58 +02:00
commit 9e2991e668
17888 changed files with 1263126 additions and 0 deletions

30
node_modules/es5-ext/test/object/copy.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict";
var stringify = JSON.stringify;
module.exports = function (t, a) {
var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o);
a.not(no, o, "Return different object");
a(stringify(no), stringify(o), "Match properties and values");
o = {
foo: "bar",
raz: {
dwa: "dwa",
trzy: { cztery: "pięć", sześć: "siedem" },
osiem: {},
dziewięć: function () {}
},
dziesięć: 10
};
o.raz.rec = o;
no = t(o);
a(o.raz, no.raz, "Shallow");
a.deep(t(o, ["foo"]), { foo: "bar" });
a.deep(t(Object.create(o), ["foo"]), { foo: "bar" });
a.deep(t(o, ["foo", "habla"]), { foo: "bar" });
a.deep(t(o, ["foo", "habla"], { ensure: true }), { foo: "bar", habla: undefined });
};