react-structured-data
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -37,3 +37,4 @@ 'use strict'; | ||
} | ||
return _react2.default.createElement( | ||
return props.dangerouslyExposeHtml ? _react2.default.createElement('script', { type: 'application/ld+json', dangerouslySetInnerHTML: { __html: JSON.stringify(json) } }) : _react2.default.createElement( | ||
'script', | ||
@@ -47,5 +48,10 @@ { type: 'application/ld+json' }, | ||
JSONLD.propTypes = { | ||
additionalType: _propTypes2.default.object | ||
additionalType: _propTypes2.default.object, | ||
dangerouslyExposeHtml: _propTypes2.default.bool | ||
}; | ||
JSONLD.defaultProps = { | ||
dangerouslyExposeHtml: false | ||
}; | ||
exports.default = JSONLD; |
@@ -19,4 +19,2 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
@@ -49,3 +47,4 @@ | ||
}; | ||
return isFirstChildNode ? _extends.apply(undefined, [_extends({}, details, schema)].concat(_toConsumableArray(parseChildren))) : _extends(_defineProperty({}, this.props.id, _extends({}, details, schema, parseChildren))); | ||
return _extends.apply(undefined, [_extends({}, details, schema)].concat(_toConsumableArray(parseChildren))); | ||
} | ||
@@ -52,0 +51,0 @@ }]); |
{ | ||
"name": "react-structured-data", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Declarative JSON-LD Structured Data for ReactJS Apps", | ||
@@ -5,0 +5,0 @@ "author": "Ben Taylor <benlt105@gmail.com>", |
689
65630