Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-json-formatter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-json-formatter - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

26

dist/index.js

@@ -5,2 +5,20 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var JsonFormatter = function JsonFormatter(_ref) {

@@ -49,5 +67,5 @@ var json = _ref.json,

var _dataJSX2 = data ? /*#__PURE__*/React.createElement("span", {
style: JsonStyle.booleanTrueStyle
style: _extends({}, JsonStyle.booleanStyle, JsonStyle.trueStyle)
}, "true") : /*#__PURE__*/React.createElement("span", {
style: JsonStyle.booleanFalseStyle
style: _extends({}, JsonStyle.booleanStyle, JsonStyle.trueStyle)
}, "false");

@@ -63,3 +81,3 @@

_dataJSX3.push( /*#__PURE__*/React.createElement(React.Fragment, {
key: '{'
key: "{"
}, /*#__PURE__*/React.createElement("span", {

@@ -87,3 +105,3 @@ style: JsonStyle.braceStyle

_dataJSX3.push( /*#__PURE__*/React.createElement(React.Fragment, {
key: '}'
key: "}"
}, repeatTabSpace(TabSpaceRepeatTimes), /*#__PURE__*/React.createElement("span", {

@@ -90,0 +108,0 @@ style: JsonStyle.braceStyle

import React from 'react';
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var JsonFormatter = function JsonFormatter(_ref) {

@@ -46,5 +64,5 @@ var json = _ref.json,

var _dataJSX2 = data ? /*#__PURE__*/React.createElement("span", {
style: JsonStyle.booleanTrueStyle
style: _extends({}, JsonStyle.booleanStyle, JsonStyle.trueStyle)
}, "true") : /*#__PURE__*/React.createElement("span", {
style: JsonStyle.booleanFalseStyle
style: _extends({}, JsonStyle.booleanStyle, JsonStyle.trueStyle)
}, "false");

@@ -60,3 +78,3 @@

_dataJSX3.push( /*#__PURE__*/React.createElement(React.Fragment, {
key: '{'
key: "{"
}, /*#__PURE__*/React.createElement("span", {

@@ -84,3 +102,3 @@ style: JsonStyle.braceStyle

_dataJSX3.push( /*#__PURE__*/React.createElement(React.Fragment, {
key: '}'
key: "}"
}, repeatTabSpace(TabSpaceRepeatTimes), /*#__PURE__*/React.createElement("span", {

@@ -87,0 +105,0 @@ style: JsonStyle.braceStyle

11

package.json
{
"name": "react-json-formatter",
"version": "0.2.0",
"version": "0.2.1",
"description": "Formatting json data to JSX of React",

@@ -30,3 +30,3 @@ "author": "ronny1020",

"peerDependencies": {
"react": "^16.13.1"
"react": ">16.0.0"
},

@@ -36,4 +36,5 @@ "devDependencies": {

"cross-env": "^7.0.2",
"eslint": "^7.7.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-react-app": "^7.0.0",
"eslint-config-standard": "^14.1.1",

@@ -48,3 +49,3 @@ "eslint-config-standard-react": "^9.2.0",

"gh-pages": "^3.1.0",
"microbundle-crl": "^0.13.11",
"microbundle-crl": "^0.13.10",
"npm-run-all": "^4.1.5",

@@ -54,3 +55,3 @@ "prettier": "^2.0.5",

"react-dom": "^16.13.1",
"react-scripts": "^3.4.3"
"react-scripts": "^5.0.0"
},

@@ -57,0 +58,0 @@ "files": [

# react-json-formatter
> React component to formate json data
> React component to formate JSON data

@@ -85,3 +85,3 @@ [![NPM](https://img.shields.io/npm/v/react-json-formatter.svg)](https://www.npmjs.com/package/react-json-formatter) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Number of spaces it should use per tab.
The number of spaces it should use per tab.
The default is 4.

@@ -91,3 +91,3 @@

Use the Object JsonStyle to control the style of formatted Json.
Use the Object JsonStyle to control the style of formatted JSON.

@@ -100,9 +100,10 @@ - from the 0.2.0 version, NOT support for className.

| colonStyle | The colons of Object. |
| style | The whole parts of the formatted Json. |
| style | The whole parts of the formatted JSON. |
| tabSpaceStyle | The space of the tabs at Object or Array. |
| numberStyle | The numbers in Json. |
| stringStyle | The strings in Json. |
| trueStyle | The boolean values of true in Json. |
| falseStyle | The boolean values of false in Json. |
| nullStyle | The null values in Json |
| numberStyle | The numbers in JSON. |
| stringStyle | The strings in JSON. |
| booleanStyle | Both boolean values in JSON. |
| trueStyle | The boolean values of true in JSON. |
| falseStyle | The boolean values of false in JSON. |
| nullStyle | The null values in JSON |
| commaStyle | The commas used in Array and Object |

@@ -109,0 +110,0 @@ | braceStyle | The braces of Object. |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc