Skip to content

Commit

Permalink
fix: avoid spread in debug function
Browse files Browse the repository at this point in the history
  • Loading branch information
dferber90 committed Dec 21, 2018
1 parent d06b8a1 commit c3eef4d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ function prettyDOM(htmlElement, maxLength, options) {
htmlElement = htmlElement.documentElement;
}

const debugContent = prettyFormat(htmlElement, {
plugins: [DOMElement, DOMCollection],
printFunctionName: false,
highlight: true,
...options
});
const debugContent = prettyFormat(
htmlElement,
Object.assign(
{
plugins: [DOMElement, DOMCollection],
printFunctionName: false,
highlight: true
},
options
)
);
return maxLength !== undefined && htmlElement.outerHTML.length > maxLength
? `${debugContent.slice(0, maxLength)}...`
: debugContent;
Expand Down

0 comments on commit c3eef4d

Please sign in to comment.