Socket
Socket
Sign inDemoInstall

pretty-format

Package Overview
Dependencies
Maintainers
3
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-format - npm Package Compare versions

Comparing version 19.1.0-alpha.eed82034 to 19.2.0-alpha.993e64af

build-es5/index.js

141

build/index.js

@@ -16,2 +16,8 @@ /**

const style = require('ansi-styles');

@@ -40,2 +46,3 @@

const toString = Object.prototype.toString;

@@ -48,3 +55,3 @@ const toISOString = Date.prototype.toISOString;

const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
const NEWLINE_REGEXP = /\n/ig;
const NEWLINE_REGEXP = /\n/gi;

@@ -54,14 +61,16 @@ const getSymbols = Object.getOwnPropertySymbols || (obj => []);

function isToStringedArrayType(toStringed) {
return toStringed === '[object Array]' ||
toStringed === '[object ArrayBuffer]' ||
toStringed === '[object DataView]' ||
toStringed === '[object Float32Array]' ||
toStringed === '[object Float64Array]' ||
toStringed === '[object Int8Array]' ||
toStringed === '[object Int16Array]' ||
toStringed === '[object Int32Array]' ||
toStringed === '[object Uint8Array]' ||
toStringed === '[object Uint8ClampedArray]' ||
toStringed === '[object Uint16Array]' ||
toStringed === '[object Uint32Array]';
return (
toStringed === '[object Array]' ||
toStringed === '[object ArrayBuffer]' ||
toStringed === '[object DataView]' ||
toStringed === '[object Float32Array]' ||
toStringed === '[object Float64Array]' ||
toStringed === '[object Int8Array]' ||
toStringed === '[object Int16Array]' ||
toStringed === '[object Int32Array]' ||
toStringed === '[object Uint8Array]' ||
toStringed === '[object Uint8ClampedArray]' ||
toStringed === '[object Uint16Array]' ||
toStringed === '[object Uint32Array]');
}

@@ -193,3 +202,4 @@

for (let i = 0; i < list.length; i++) {
body += innerIndent +
body +=
innerIndent +
print(

@@ -239,19 +249,21 @@ list[i],

{
return (min ? '' : 'Arguments ') +
printList(
val,
indent,
prevIndent,
spacing,
edgeSpacing,
refs,
maxDepth,
currentDepth,
plugins,
min,
callToJSON,
printFunctionName,
escapeRegex,
colors);
return (
(min ? '' : 'Arguments ') +
printList(
val,
indent,
prevIndent,
spacing,
edgeSpacing,
refs,
maxDepth,
currentDepth,
plugins,
min,
callToJSON,
printFunctionName,
escapeRegex,
colors));
}

@@ -275,19 +287,21 @@

{
return (min ? '' : val.constructor.name + ' ') +
printList(
val,
indent,
prevIndent,
spacing,
edgeSpacing,
refs,
maxDepth,
currentDepth,
plugins,
min,
callToJSON,
printFunctionName,
escapeRegex,
colors);
return (
(min ? '' : val.constructor.name + ' ') +
printList(
val,
indent,
prevIndent,
spacing,
edgeSpacing,
refs,
maxDepth,
currentDepth,
plugins,
min,
callToJSON,
printFunctionName,
escapeRegex,
colors));
}

@@ -482,3 +496,4 @@

while (!current.done) {
result += innerIndent +
result +=
innerIndent +
print(

@@ -542,3 +557,6 @@ current.value[1],

if (
callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function')
callToJSON &&
!hitMaxDepth &&
val.toJSON &&
typeof val.toJSON === 'function')
{

@@ -794,2 +812,3 @@ return print(

theme: {
comment: 'gray',
content: 'reset',

@@ -848,4 +867,3 @@ prop: 'yellow',

const themeDefaults = DEFAULTS.theme;
return Object.keys(themeDefaults).reduce(
(theme, key) => {
return Object.keys(themeDefaults).reduce((theme, key) => {
theme[key] = Object.prototype.hasOwnProperty.call(themeOption, key) ?

@@ -855,5 +873,3 @@ themeRefined[key] :

return theme;
},
{});
}, {});
}

@@ -874,3 +890,9 @@

const colors = {};
const colors = {
comment: { close: '', open: '' },
content: { close: '', open: '' },
prop: { close: '', open: '' },
tag: { close: '', open: '' },
value: { close: '', open: '' } };
Object.keys(opts.theme).forEach(key => {

@@ -888,4 +910,2 @@ if (opts.highlight) {

}
} else {
colors[key] = { close: '', open: '' };
}

@@ -958,2 +978,11 @@ });

prettyFormat.plugins = {
AsymmetricMatcher: require('./plugins/AsymmetricMatcher'),
ConvertAnsi: require('./plugins/ConvertAnsi'),
HTMLElement: require('./plugins/HTMLElement'),
Immutable: require('./plugins/ImmutablePlugins'),
ReactElement: require('./plugins/ReactElement'),
ReactTestComponent: require('./plugins/ReactTestComponent') };
module.exports = prettyFormat;

@@ -7,2 +7,3 @@ /**

* of patent rights can be found in the PATENTS file in the same directory.
*
*

@@ -9,0 +10,0 @@ */

@@ -33,3 +33,4 @@ /**

isMap ? ['{', '}'] : ['[', ']'],_ref2 = _slicedToArray(_ref, 2);const openTag = _ref2[0],closeTag = _ref2[1];
let result = IMMUTABLE_NAMESPACE +
let result =
IMMUTABLE_NAMESPACE +
immutableDataStructureName +

@@ -46,2 +47,3 @@ SPACE +

result += immutableArray.join(',' + opts.spacing);

@@ -52,7 +54,9 @@ if (!opts.min && immutableArray.length > 0) {

return result +
addFinalEdgeSpacing(immutableArray.length, opts.edgeSpacing) +
closeTag;
return (
result +
addFinalEdgeSpacing(immutableArray.length, opts.edgeSpacing) +
closeTag);
};
module.exports = printImmutable;

@@ -7,4 +7,6 @@ /**

* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
/* eslint-disable max-len */
'use strict';

@@ -53,3 +55,4 @@

if (printed.indexOf('\n') !== -1) {
printed = '{' +
printed =
'{' +
opts.edgeSpacing +

@@ -62,7 +65,9 @@ indent(indent(printed) + opts.edgeSpacing + '}');

return opts.spacing +
indent(colors.prop.open + name + colors.prop.close + '=') +
colors.value.open +
printed +
colors.value.close;
return (
opts.spacing +
indent(colors.prop.open + name + colors.prop.close + '=') +
colors.value.open +
printed +
colors.value.close);
}).

@@ -103,3 +108,4 @@ join('');

const children = printChildren(flatChildren, print, indent, colors, opts);
result += colors.tag.open + (
result +=
colors.tag.open + (
closeInNewLine ? '\n' : '') +

@@ -117,6 +123,4 @@ '>' +

} else {
result += colors.tag.open + (
closeInNewLine ? '\n' : ' ') +
'/>' +
colors.tag.close;
result +=
colors.tag.open + (closeInNewLine ? '\n' : ' ') + '/>' + colors.tag.close;
}

@@ -123,0 +127,0 @@

@@ -10,3 +10,3 @@ /**

*/
/* eslint-disable max-len */
'use strict';

@@ -49,3 +49,4 @@

if (printed.indexOf('\n') !== -1) {
printed = '{' +
printed =
'{' +
opts.edgeSpacing +

@@ -58,7 +59,9 @@ indent(indent(printed) + opts.edgeSpacing + '}');

return opts.spacing +
indent(colors.prop.open + name + colors.prop.close + '=') +
colors.value.open +
printed +
colors.value.close;
return (
opts.spacing +
indent(colors.prop.open + name + colors.prop.close + '=') +
colors.value.open +
printed +
colors.value.close);
}).

@@ -79,4 +82,2 @@ join('');

if (instance.props) {
// If assignments are in opposite order, Flow 0.39.0 finds incorrect error:
// element of Object.keys. Expected object instead of possibly undefined value
closeInNewLine = !!Object.keys(instance.props).length && !opts.min;

@@ -94,3 +95,4 @@ result += printProps(instance.props, print, indent, colors, opts);

result += colors.tag.open + (
result +=
colors.tag.open + (
closeInNewLine ? '\n' : '') +

@@ -108,6 +110,4 @@ '>' +

} else {
result += colors.tag.open + (
closeInNewLine ? '\n' : ' ') +
'/>' +
colors.tag.close;
result +=
colors.tag.open + (closeInNewLine ? '\n' : ' ') + '/>' + colors.tag.close;
}

@@ -114,0 +114,0 @@

{
"name": "pretty-format",
"version": "19.1.0-alpha.eed82034",
"version": "19.2.0-alpha.993e64af",
"repository": {

@@ -11,2 +11,3 @@ "type": "git",

"main": "build/index.js",
"browser": "build-es5/index.js",
"author": "James Kyle <me@thejameskyle.com>",

@@ -13,0 +14,0 @@ "dependencies": {

@@ -120,4 +120,4 @@ # pretty-format

const prettyFormat = require('pretty-format');
const reactTestPlugin = require('pretty-format/build/plugins/ReactTestComponent');
const reactElementPlugin = require('pretty-format/build/plugins/ReactElement');
const reactTestPlugin = require('pretty-format').plugins.ReactTestComponent;
const reactElementPlugin = require('pretty-format').plugins.ReactElement;

@@ -124,0 +124,0 @@ const React = require('react');

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