UNPKG

merge-cobertura

Version:
22 lines 620 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.flatten = exports.addSelfClosingTags = void 0; /** * Replaces immediately-closing tags with self-closing tags, e.g replaces `<line></line>` with `<line/>` * * @param xml XML input */ function addSelfClosingTags(xml) { return xml.replace(/(<([a-zA-Z0-9]+)(\s[^>]*)?)><\/\2>/g, '$1/>'); } exports.addSelfClosingTags = addSelfClosingTags; /** * flattens an array of arrays * * @param arr the arrays to merge */ function flatten(arr) { return [].concat(...arr); } exports.flatten = flatten; //# sourceMappingURL=util.js.map