1 2 3 4 5 6 7 8 9 10 11
let cloneNodeCount = 0; const origCloneNode = Node.prototype.cloneNode; Node.prototype.cloneNode = function (...args) { cloneNodeCount += 1; return origCloneNode.apply(this, args); }; export function getCloneNodeCount() { return cloneNodeCount; }