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 baff25e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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) {
): string => {
if (element instanceof Text) {
return element.data;
}

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

Expand Down

0 comments on commit baff25e

Please sign in to comment.