New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-json-pretty

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-json-pretty - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

2

example/app/Example.jsx

@@ -8,3 +8,3 @@ var React = require('react');

bbbb: true,
cccc: "abcd",
cccc: "ab\"cd\\",
dddd: {

@@ -11,0 +11,0 @@ eeee: 1,

@@ -24,4 +24,5 @@ {

"stylus-loader": "^1.4.2",
"webpack": "^1.12.9"
"webpack": "^1.12.9",
"react-json-pretty": "~1.2.1"
}
}

@@ -10,2 +10,3 @@ var React = require('react');

var strSpan = '<span class=json-string>';
var booSpan = '<span class=json-boolean>';
var sps = ind || '';

@@ -15,5 +16,12 @@ if (key) {

}
if (val) {
sps = sps + (val[0] == '"' ? strSpan : valSpan) + val + spanEnd;
if (val === "true" || val === "false") {
sps = sps + (val[0] == '"' ? strSpan : booSpan) + val + spanEnd;
}
else {
sps = sps + (val[0] == '"' ? strSpan : valSpan) + val + spanEnd;
}
}
return sps + (tra || '');

@@ -26,3 +34,3 @@ },

return JSON.stringify(obj, null, 2)
.replace(/&/g, '&amp;').replace(/\\"/g, '&quot;')
.replace(/&/g, '&amp;').replace(/\\"([^,])/g, '&quot;$1')
.replace(/</g, '&lt;').replace(/>/g, '&gt;')

@@ -29,0 +37,0 @@ .replace(regLine, this._replace);

{
"name": "react-json-pretty",
"version": "1.2.1",
"version": "1.2.2",
"description": "A code formatting tool for raw json data",

@@ -5,0 +5,0 @@ "main": "src/JSONPretty.js",

@@ -18,2 +18,3 @@ 'use strict';

var strSpan = '<span class=json-string>';
var booSpan = '<span class=json-boolean>';
var sps = ind || '';

@@ -23,5 +24,11 @@ if (key) {

}
if (val) {
sps = sps + (val[0] == '"' ? strSpan : valSpan) + val + spanEnd;
if (val === "true" || val === "false") {
sps = sps + (val[0] == '"' ? strSpan : booSpan) + val + spanEnd;
} else {
sps = sps + (val[0] == '"' ? strSpan : valSpan) + val + spanEnd;
}
}
return sps + (tra || '');

@@ -33,3 +40,3 @@ },

var regLine = /^( *)("[^"]+": )?("[^"]*"|[\w.+-]*)?([,[{]|\[\s*\],?|\{\s*\},?)?$/mg;
return JSON.stringify(obj, null, 2).replace(/&/g, '&amp;').replace(/\\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(regLine, this._replace);
return JSON.stringify(obj, null, 2).replace(/&/g, '&amp;').replace(/\\"([^,])/g, '&quot;$1').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(regLine, this._replace);
},

@@ -39,7 +46,6 @@ render: function render() {

// See https://facebook.github.io/react/warnings/unknown-prop.html
var _props = this.props;
var json = _props.json;
var _props = this.props,
json = _props.json,
rest = _objectWithoutProperties(_props, ['json']);
var rest = _objectWithoutProperties(_props, ['json']);
if (typeof json === 'string') {

@@ -46,0 +52,0 @@ try {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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