Skip to content

Commit

Permalink
Add type to element in html pretty printer
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 23, 2017
1 parent e7bc468 commit 7723299
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/pretty-format/src/plugins/HTMLElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ function printAttributes(attributes, print, indent, colors, opts) {
}

const print = (
element: any,
element: HTMLElement | Text | Comment,
print: Print,
indent: Indent,
opts: Options,
colors: Colors,
) => {
if (element.nodeType === 3) {
if (element instanceof Text) {
return element.data;
}

if (element.nodeType === 8) {
if (element instanceof Comment) {
return `<!--${element.data}-->`;
}

Expand Down

0 comments on commit 7723299

Please sign in to comment.