react-element-to-jsx-string
Advanced tools
Comparing version
<a name="1.1.1"></a> | ||
## [1.1.1](https://github.com/algolia/react-element-to-jsx-string/compare/v1.1.1...v1.1.1) (2015-10-16) | ||
### Bug Fixes | ||
* handle null and undefined prop values ([9a57a10](https://github.com/algolia/react-element-to-jsx-string/commit/9a57a10)), closes [#1](https://github.com/algolia/react-element-to-jsx-string/issues/1) | ||
<a name="1.1.1"></a> | ||
## [1.1.1](https://github.com/algolia/react-element-to-jsx-string/compare/v1.1.0...v1.1.1) (2015-10-15) | ||
@@ -3,0 +13,0 @@ |
@@ -141,3 +141,3 @@ 'use strict'; | ||
// sortobject fails on some types, like regex | ||
if (Object.keys(obj).length > 0) { | ||
if (obj && Object.keys(obj).length > 0) { | ||
obj = (0, _sortobject2['default'])(obj); | ||
@@ -144,0 +144,0 @@ } |
@@ -155,3 +155,3 @@ /* eslint-env mocha */ | ||
it('ignores object keys order (sortobject)', () => { | ||
it(`ignores object keys order (sortobject)`, () => { | ||
expect( | ||
@@ -163,2 +163,18 @@ reactElementToJSXString(<div o={{a: 1, b: 2}}/>) | ||
}); | ||
it(`reactElementToJSXString(<div a={null} />`, () => { | ||
expect( | ||
reactElementToJSXString(<div a={null} />) | ||
).toEqual( | ||
reactElementToJSXString(<div a={null} />) | ||
); | ||
}); | ||
it(`reactElementToJSXString(<div a={undefined} />`, () => { | ||
expect( | ||
reactElementToJSXString(<div a={undefined} />) | ||
).toEqual( | ||
reactElementToJSXString(<div a={undefined} />) | ||
); | ||
}); | ||
}); |
@@ -120,3 +120,3 @@ import React from 'react'; | ||
// sortobject fails on some types, like regex | ||
if (Object.keys(obj).length > 0) { | ||
if (obj && Object.keys(obj).length > 0) { | ||
obj = sortobject(obj); | ||
@@ -123,0 +123,0 @@ } |
{ | ||
"name": "react-element-to-jsx-string", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Turn a ReactElement into the corresponding JSX string.", | ||
@@ -5,0 +5,0 @@ "main": "index-dist.js", |
16720
4.78%387
3.75%