Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 | 700x 700x 168x 113x 55x 55x 55x 168x 168x 168x 7154x 700x | /* eslint-disable no-undef */
const prettier = require('prettier');
const print = val => {
let source;
if (val.getAttribute('ng-version')) {
source = val.innerHTML;
} else {
const tmp = document.createElement('div');
tmp.appendChild(val);
source = tmp.innerHTML;
}
source = source
.replace(/\n/g, '')
.replace(/<!--.*?-->/g, '')
.replace(/ng-reflect-klass="[^"]*"/g, '')
.replace(/ng-reflect-[a-z-]*="\[object Object]"/g, '')
.replace(/_nghost.*=""/g, '');
const result = prettier.format(source, { parser: 'html', printWidth: 100 }).replace(/^\s*$/g, '').trim();
return result || 'N/A';
};
const test = val => val instanceof Element;
module.exports = {
print: print,
test: test,
};
|