pretty-format
Advanced tools
Comparing version 21.3.0-beta.2 to 21.3.0-beta.3
@@ -45,4 +45,8 @@ 'use strict'; | ||
* | ||
*/const toISOString = Date.prototype.toISOString;const errorToString = Error.prototype.toString;const regExpToString = RegExp.prototype.toString;const symbolToString = Symbol.prototype.toString;const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;const NEWLINE_REGEXP = /\n/gi; | ||
*/const toISOString = Date.prototype.toISOString;const errorToString = Error.prototype.toString;const regExpToString = RegExp.prototype.toString;const symbolToString = Symbol.prototype.toString; // Is val is equal to global window object? Works even if it does not exist :) | ||
/* global window */const isWindow = val => typeof window !== 'undefined' && val === window; | ||
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/; | ||
const NEWLINE_REGEXP = /\n/gi; | ||
function isToStringedArrayType(toStringed) { | ||
@@ -228,3 +232,5 @@ return ( | ||
return hitMaxDepth ? | ||
// Avoid failure to serialize global window object in jsdom test environment. | ||
// For example, not even relevant if window is prop of React element. | ||
return hitMaxDepth || isWindow(val) ? | ||
'[' + (val.constructor ? val.constructor.name : 'Object') + ']' : | ||
@@ -354,4 +360,5 @@ (min ? '' : (val.constructor ? val.constructor.name : 'Object') + ' ') + | ||
const getColorsHighlight = options => | ||
DEFAULT_THEME_KEYS.reduce((colors, key) => { | ||
const getColorsHighlight = (options | ||
// $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS` | ||
) => DEFAULT_THEME_KEYS.reduce((colors, key) => { | ||
const value = | ||
@@ -374,9 +381,10 @@ options.theme && options.theme[key] !== undefined ? | ||
return colors; | ||
}, {}); | ||
}, Object.create(null)); | ||
const getColorsEmpty = () => | ||
// $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS` | ||
DEFAULT_THEME_KEYS.reduce((colors, key) => { | ||
colors[key] = { close: '', open: '' }; | ||
return colors; | ||
}, {}); | ||
}, Object.create(null)); | ||
@@ -383,0 +391,0 @@ const getPrintFunctionName = options => |
{ | ||
"name": "pretty-format", | ||
"version": "21.3.0-beta.2", | ||
"version": "21.3.0-beta.3", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
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
420656
5520