Socket
Socket
Sign inDemoInstall

pretty-format

Package Overview
Dependencies
0
Maintainers
2
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.2.1 to 4.2.2

2

package.json
{
"name": "pretty-format",
"version": "4.2.1",
"version": "4.2.2",
"description": "Stringify any JavaScript value.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -49,3 +49,10 @@ 'use strict';

function printElement(element, print, indent, opts) {
let result = '<' + element.type;
let result = '<';
if (typeof element.type === 'string') {
result += element.type;
} else if (typeof element.type === 'function') {
result += element.type.displayName || element.type.name || 'Unknown';
} else {
result += 'Unknown';
}
result += printProps(element.props, print, indent, opts);

@@ -52,0 +59,0 @@

@@ -77,7 +77,8 @@ # pretty-format [![Travis build status](http://img.shields.io/travis/thejameskyle/pretty-format.svg?style=flat)](https://travis-ci.org/thejameskyle/pretty-format)

#### `ReactTestComponent` plugin
#### `ReactTestComponent` and `ReactElement` plugins
```js
var prettyFormat = require('pretty-format');
var reactPlugin = require('pretty-format/plugins/ReactTestComponent');
var reactTestPlugin = require('pretty-format/plugins/ReactTestComponent');
var reactElementPlugin = require('pretty-format/plugins/ReactElement');

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

prettyFormat(renderer.create(jsx).toJSON(), {
plugins: [reactPlugin]
plugins: [reactTestPlugin, reactElementPlugin]
});

@@ -93,0 +94,0 @@ // <h1>

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc