html2react
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -25,4 +25,4 @@ 'use strict'; | ||
return attributes.reduce(function (props, _ref) { | ||
var name = _ref.name; | ||
var value = _ref.value; | ||
var name = _ref.name, | ||
value = _ref.value; | ||
@@ -52,9 +52,7 @@ var propName = getPropName(name, element); | ||
return props.reduce(function (props, prop) { | ||
var _prop$split = prop.split(/:(.+)?/); | ||
var _prop$split = prop.split(/:(.+)?/), | ||
_prop$split2 = _slicedToArray(_prop$split, 2), | ||
propName = _prop$split2[0], | ||
propValue = _prop$split2[1]; | ||
var _prop$split2 = _slicedToArray(_prop$split, 2); | ||
var propName = _prop$split2[0]; | ||
var propValue = _prop$split2[1]; | ||
propName = formatStylePropName(propName); | ||
@@ -61,0 +59,0 @@ propValue = propValue.trim(); |
@@ -23,3 +23,3 @@ 'use strict'; | ||
var HTML2React = function HTML2React() { | ||
var elementOverrides = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var elementOverrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return function (content) { | ||
@@ -26,0 +26,0 @@ // Put in a temporary container so we can traverse the tree. |
@@ -15,3 +15,3 @@ 'use strict'; | ||
function isNodeSupported() { | ||
var node = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -32,3 +32,3 @@ return !(isTagNameIgnored(node.tagName) || isNodeTypeIgnored(node.nodeType) || isNodeValueIgnored(node.nodeValue)); | ||
var isTagNameIgnored = function isTagNameIgnored() { | ||
var tagName = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; | ||
var tagName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
return IGNORED_TAG_NAMES.indexOf(tagName.toLowerCase()) > -1; | ||
@@ -35,0 +35,0 @@ }; |
@@ -38,4 +38,4 @@ 'use strict'; | ||
function parseNodes() { | ||
var nodes = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; | ||
var elementOverrides = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
var elementOverrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -42,0 +42,0 @@ return Array.from(nodes).filter(_isNodeSupported2.default).map(function (node, index) { |
{ | ||
"name": "html2react", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Utility for turning raw HTML into React elements", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# HTML2React | ||
[![Build Status](https://img.shields.io/travis/Deschtex/html2react.svg?style=flat-square)](https://travis-ci.org/Deschtex/html2react) | ||
[![npm version](https://img.shields.io/npm/v/html2react.svg?maxAge=2592000&style=flat-square)](https://www.npmjs.org/package/html2react) | ||
[![npm version](https://img.shields.io/npm/v/html2react.svg?style=flat-square)](https://www.npmjs.com/package/html2react) | ||
@@ -6,0 +6,0 @@ A utility for turning raw HTML into React elements. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18501
19