-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
38 lines (32 loc) · 817 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { mergeData } = require("../dist/lib.common");
const { Suite } = require("benchmark");
let mergeSuite = new Suite("mergeData", {
onCycle(e) {
console.log(e.target.toString());
},
});
let tests = [];
tests.push(function basic() {
mergeData(
{
staticClass: "btn",
class: { "btn-primary": true },
},
{ class: ["btn-block"] }
);
});
tests.push(function multi() {
mergeData(
{ style: { position: "absolute" } },
{ style: "position: relative; left:0;right:50% ;" },
{ staticClass: "btn", class: { "btn-primary": true } },
{ class: ["btn-block"] },
{ on: { click() {}, mouseup() {} } },
{ on: { click() {}, mouseup() {} } },
{ class: { "text-center": true } }
);
});
for (const fn of tests) {
mergeSuite.add(fn.name, fn);
}
mergeSuite.run();