react-json-renderer
Advanced tools
Comparing version 0.4.0 to 0.5.0
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.__esModule = true; | ||
exports.convertToJSON = exports.convertToObject = undefined; | ||
@@ -7,0 +5,0 @@ |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.__esModule = true; | ||
@@ -7,0 +5,0 @@ var _converter = require('./converter'); |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.__esModule = true; | ||
exports.Renderer = exports.renderFromObject = undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react = require('react'); | ||
@@ -74,21 +70,18 @@ | ||
return _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).apply(this, arguments)); | ||
return _possibleConstructorReturn(this, _PureComponent.apply(this, arguments)); | ||
} | ||
_createClass(Renderer, [{ | ||
key: 'render', | ||
value: function render() { | ||
var _props = this.props, | ||
json = _props.json, | ||
tree = _props.tree, | ||
params = _objectWithoutProperties(_props, ['json', 'tree']); | ||
Renderer.prototype.render = function render() { | ||
var _props = this.props, | ||
json = _props.json, | ||
tree = _props.tree, | ||
params = _objectWithoutProperties(_props, ['json', 'tree']); | ||
var obj = void 0; | ||
if (tree) obj = tree;else if (json) obj = JSON.parse(json); // flowlint-line sketchy-null-string:off | ||
var obj = void 0; | ||
if (tree) obj = tree;else if (json) obj = JSON.parse(json); // flowlint-line sketchy-null-string:off | ||
return obj ? renderFromObject(obj, params) : null; | ||
} | ||
}]); | ||
return obj ? renderFromObject(obj, params) : null; | ||
}; | ||
return Renderer; | ||
}(_react.PureComponent); |
{ | ||
"name": "react-json-renderer", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Render React components to a JSON tree", | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"jsnext:main": "es/index.js", | ||
"scripts": { | ||
"build:clean": "del lib", | ||
"build:compile": "babel src --out-dir lib", | ||
"build:flow": "flow-copy-source src lib", | ||
"build:types": "cp ./lib/types.js.flow ./types.js", | ||
"build": "npm run build:clean && npm run build:compile && npm run build:flow && npm run build:types", | ||
"build:clean": "del es lib", | ||
"compile:lib": "babel src --out-dir lib", | ||
"compile:es": "BABEL_ENV=esm babel src --out-dir es", | ||
"build:compile": "npm run compile:lib && npm run compile:es", | ||
"build:flow": "flow-copy-source src lib && flow-copy-source src es", | ||
"build": "npm run build:clean && npm run build:compile && npm run build:flow", | ||
"flow": "flow check", | ||
"lint": "eslint ./src", | ||
"jest": "jest", | ||
"jest": "BABEL_ENV=development jest", | ||
"test": "npm run lint && npm run flow && npm run jest", | ||
"start": "npm test && npm run build", | ||
"prepublishOnly": "npm start" | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -42,3 +45,3 @@ "repository": { | ||
"del-cli": "^1.1.0", | ||
"eslint": "^4.4.1", | ||
"eslint": "^4.5.0", | ||
"eslint-config-prettier": "^2.3.0", | ||
@@ -48,3 +51,3 @@ "eslint-plugin-flowtype": "^2.35.0", | ||
"eslint-plugin-react": "^7.2.1", | ||
"flow-bin": "^0.53.0", | ||
"flow-bin": "^0.53.1", | ||
"flow-copy-source": "^1.2.0", | ||
@@ -51,0 +54,0 @@ "jest": "^20.0.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
173435
21
296