Total Complexity | 7 |
Complexity/F | 1.75 |
Lines of Code | 21 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | // utilities |
||
3 | export const noop = () => {} |
||
4 | |||
5 | export const cloneObj = function (obj) { |
||
6 | return Object.assign({}, obj) |
||
7 | } |
||
8 | |||
9 | export const mergeObjs = function () { |
||
10 | return Object.assign(...(Object.values(arguments).map(cloneObj))) |
||
11 | } |
||
12 | |||
13 | export const clickNode = function (node) { |
||
14 | if (document.createEvent) { |
||
15 | let evt = document.createEvent('MouseEvents'); |
||
16 | evt.initEvent('click', true, false); |
||
17 | node.dispatchEvent(evt); |
||
18 | } else if (document.createEventObject) { |
||
19 | node.fireEvent('onclick'); |
||
20 | } else if (typeof node.onclick === 'function') { |
||
21 | node.onclick(); |
||
22 | } |
||
23 | } |