Skip to content

Commit 1d9ab19

Browse files
fix: ensure backwards compatibility for html-dom-parser's ES Module
Fixes #445
1 parent 03747b8 commit 1d9ab19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ var domToReact = require('./lib/dom-to-react');
22
var attributesToProps = require('./lib/attributes-to-props');
33
var htmlToDOM = require('html-dom-parser');
44

5+
// support backwards compatibility for ES Module
6+
htmlToDOM =
7+
typeof htmlToDOM.default === 'function' ? htmlToDOM.default : htmlToDOM;
8+
59
var domParserOptions = { lowerCaseAttributeNames: false };
610

711
/**

0 commit comments

Comments
 (0)