1 |
- {"ast":null,"code":"'use strict';\n\nvar _ansiStyles = _interopRequireDefault(require('ansi-styles'));\n\nvar _collections = require('./collections');\n\nvar _AsymmetricMatcher = _interopRequireDefault(require('./plugins/AsymmetricMatcher'));\n\nvar _ConvertAnsi = _interopRequireDefault(require('./plugins/ConvertAnsi'));\n\nvar _DOMCollection = _interopRequireDefault(require('./plugins/DOMCollection'));\n\nvar _DOMElement = _interopRequireDefault(require('./plugins/DOMElement'));\n\nvar _Immutable = _interopRequireDefault(require('./plugins/Immutable'));\n\nvar _ReactElement = _interopRequireDefault(require('./plugins/ReactElement'));\n\nvar _ReactTestComponent = _interopRequireDefault(require('./plugins/ReactTestComponent'));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable local/ban-types-eventually */\n\n\nconst toString = Object.prototype.toString;\nconst toISOString = Date.prototype.toISOString;\nconst errorToString = Error.prototype.toString;\nconst regExpToString = RegExp.prototype.toString;\n/**\n * Explicitly comparing typeof constructor to function avoids undefined as name\n * when mock identity-obj-proxy returns the key as the value for any key.\n */\n\nconst getConstructorName = val => typeof val.constructor === 'function' && val.constructor.name || 'Object';\n/* global window */\n\n/** Is val is equal to global window object? Works even if it does not exist :) */\n\n\nconst isWindow = val => typeof window !== 'undefined' && val === window;\n\nconst SYMBOL_REGEXP = /^Symbol\\((.*)\\)(.*)$/;\nconst NEWLINE_REGEXP = /\\n/gi;\n\nclass PrettyFormatPluginError extends Error {\n constructor(message, stack) {\n super(message);\n this.stack = stack;\n this.name = this.constructor.name;\n }\n\n}\n\nfunction isToStringedArrayType(toStringed) {\n 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]';\n}\n\nfunction printNumber(val) {\n return Object.is(val, -0) ? '-0' : String(val);\n}\n\nfunction printBigInt(val) {\n return String(`${val}n`);\n}\n\nfunction printFunction(val, printFunctionName) {\n if (!printFunctionName) {\n return '[Function]';\n }\n\n return '[Function ' + (val.name || 'anonymous') + ']';\n}\n\nfunction printSymbol(val) {\n return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');\n}\n\nfunction printError(val) {\n return '[' + errorToString.call(val) + ']';\n}\n/**\n * The first port of call for printing an object, handles most of the\n * data-types in JS.\n */\n\n\nfunction printBasicValue(val, printFunctionName, escapeRegex, escapeString) {\n if (val === true || val === false) {\n return '' + val;\n }\n\n if (val === undefined) {\n return 'undefined';\n }\n\n if (val === null) {\n return 'null';\n }\n\n const typeOf = typeof val;\n\n if (typeOf === 'number') {\n return printNumber(val);\n }\n\n if (typeOf === 'bigint') {\n return printBigInt(val);\n }\n\n if (typeOf === 'string') {\n if (escapeString) {\n return '\"' + val.replace(/\"|\\\\/g, '\\\\$&') + '\"';\n }\n\n return '\"' + val + '\"';\n }\n\n if (typeOf === 'function') {\n return printFunction(val, printFunctionName);\n }\n\n if (typeOf === 'symbol') {\n return printSymbol(val);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object WeakMap]') {\n return 'WeakMap {}';\n }\n\n if (toStringed === '[object WeakSet]') {\n return 'WeakSet {}';\n }\n\n if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') {\n return printFunction(val, printFunctionName);\n }\n\n if (toStringed === '[object Symbol]') {\n return printSymbol(val);\n }\n\n if (toStringed === '[object Date]') {\n return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);\n }\n\n if (toStringed === '[object Error]') {\n return printError(val);\n }\n\n if (toStringed === '[object RegExp]') {\n if (escapeRegex) {\n // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js\n return regExpToString.call(val).replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n return regExpToString.call(val);\n }\n\n if (val instanceof Error) {\n return printError(val);\n }\n\n return null;\n}\n/**\n * Handles more complex objects ( such as objects with circular references.\n * maps and sets etc )\n */\n\n\nfunction printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {\n if (refs.indexOf(val) !== -1) {\n return '[Circular]';\n }\n\n refs = refs.slice();\n refs.push(val);\n const hitMaxDepth = ++depth > config.maxDepth;\n const min = config.min;\n\n if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {\n return printer(val.toJSON(), config, indentation, depth, refs, true);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object Arguments]') {\n return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';\n }\n\n if (isToStringedArrayType(toStringed)) {\n return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';\n }\n\n if (toStringed === '[object Map]') {\n return hitMaxDepth ? '[Map]' : 'Map {' + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';\n }\n\n if (toStringed === '[object Set]') {\n return hitMaxDepth ? '[Set]' : 'Set {' + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + '}';\n } // Avoid failure to serialize global window object in jsdom test environment.\n // For example, not even relevant if window is prop of React element.\n\n\n return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + (0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer) + '}';\n}\n\nfunction isNewPlugin(plugin) {\n return plugin.serialize != null;\n}\n\nfunction printPlugin(plugin, val, config, indentation, depth, refs) {\n let printed;\n\n try {\n printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, valChild => printer(valChild, config, indentation, depth, refs), str => {\n const indentationNext = indentation + config.indent;\n return indentationNext + str.replace(NEWLINE_REGEXP, '\\n' + indentationNext);\n }, {\n edgeSpacing: config.spacingOuter,\n min: config.min,\n spacing: config.spacingInner\n }, config.colors);\n } catch (error) {\n throw new PrettyFormatPluginError(error.message, error.stack);\n }\n\n if (typeof printed !== 'string') {\n throw new Error(`pretty-format: Plugin must return type \"string\" but instead returned \"${typeof printed}\".`);\n }\n\n return printed;\n}\n\nfunction findPlugin(plugins, val) {\n for (let p = 0; p < plugins.length; p++) {\n try {\n if (plugins[p].test(val)) {\n return plugins[p];\n }\n } catch (error) {\n throw new PrettyFormatPluginError(error.message, error.stack);\n }\n }\n\n return null;\n}\n\nfunction printer(val, config, indentation, depth, refs, hasCalledToJSON) {\n const plugin = findPlugin(config.plugins, val);\n\n if (plugin !== null) {\n return printPlugin(plugin, val, config, indentation, depth, refs);\n }\n\n const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);\n\n if (basicResult !== null) {\n return basicResult;\n }\n\n return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);\n}\n\nconst DEFAULT_THEME = {\n comment: 'gray',\n content: 'reset',\n prop: 'yellow',\n tag: 'cyan',\n value: 'green'\n};\nconst DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);\nconst DEFAULT_OPTIONS = {\n callToJSON: true,\n escapeRegex: false,\n escapeString: true,\n highlight: false,\n indent: 2,\n maxDepth: Infinity,\n min: false,\n plugins: [],\n printFunctionName: true,\n theme: DEFAULT_THEME\n};\n\nfunction validateOptions(options) {\n Object.keys(options).forEach(key => {\n if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {\n throw new Error(`pretty-format: Unknown option \"${key}\".`);\n }\n });\n\n if (options.min && options.indent !== undefined && options.indent !== 0) {\n throw new Error('pretty-format: Options \"min\" and \"indent\" cannot be used together.');\n }\n\n if (options.theme !== undefined) {\n if (options.theme === null) {\n throw new Error(`pretty-format: Option \"theme\" must not be null.`);\n }\n\n if (typeof options.theme !== 'object') {\n throw new Error(`pretty-format: Option \"theme\" must be of type \"object\" but instead received \"${typeof options.theme}\".`);\n }\n }\n}\n\nconst getColorsHighlight = options => DEFAULT_THEME_KEYS.reduce((colors, key) => {\n const value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key];\n const color = value && _ansiStyles.default[value];\n\n if (color && typeof color.close === 'string' && typeof color.open === 'string') {\n colors[key] = color;\n } else {\n throw new Error(`pretty-format: Option \"theme\" has a key \"${key}\" whose value \"${value}\" is undefined in ansi-styles.`);\n }\n\n return colors;\n}, Object.create(null));\n\nconst getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors, key) => {\n colors[key] = {\n close: '',\n open: ''\n };\n return colors;\n}, Object.create(null));\n\nconst getPrintFunctionName = options => options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;\n\nconst getEscapeRegex = options => options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;\n\nconst getEscapeString = options => options && options.escapeString !== undefined ? options.escapeString : DEFAULT_OPTIONS.escapeString;\n\nconst getConfig = options => ({\n callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,\n colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),\n escapeRegex: getEscapeRegex(options),\n escapeString: getEscapeString(options),\n indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent),\n maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,\n min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,\n plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins,\n printFunctionName: getPrintFunctionName(options),\n spacingInner: options && options.min ? ' ' : '\\n',\n spacingOuter: options && options.min ? '' : '\\n'\n});\n\nfunction createIndent(indent) {\n return new Array(indent + 1).join(' ');\n}\n/**\n * Returns a presentation string of your `val` object\n * @param val any potential JavaScript object\n * @param options Custom settings\n */\n\n\nfunction prettyFormat(val, options) {\n if (options) {\n validateOptions(options);\n\n if (options.plugins) {\n const plugin = findPlugin(options.plugins, val);\n\n if (plugin !== null) {\n return printPlugin(plugin, val, getConfig(options), '', 0, []);\n }\n }\n }\n\n const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));\n\n if (basicResult !== null) {\n return basicResult;\n }\n\n return printComplexValue(val, getConfig(options), '', 0, []);\n}\n\nprettyFormat.plugins = {\n AsymmetricMatcher: _AsymmetricMatcher.default,\n ConvertAnsi: _ConvertAnsi.default,\n DOMCollection: _DOMCollection.default,\n DOMElement: _DOMElement.default,\n Immutable: _Immutable.default,\n ReactElement: _ReactElement.default,\n ReactTestComponent: _ReactTestComponent.default\n};\nmodule.exports = prettyFormat;","map":{"version":3,"sources":["/Users/jane/Documents/Курс Front-end/HW8/myproject/node_modules/pretty-format/build/index.js"],"names":["_ansiStyles","_interopRequireDefault","require","_collections","_AsymmetricMatcher","_ConvertAnsi","_DOMCollection","_DOMElement","_Immutable","_ReactElement","_ReactTestComponent","obj","__esModule","default","toString","Object","prototype","toISOString","Date","errorToString","Error","regExpToString","RegExp","getConstructorName","val","constructor","name","isWindow","window","SYMBOL_REGEXP","NEWLINE_REGEXP","PrettyFormatPluginError","message","stack","isToStringedArrayType","toStringed","printNumber","is","String","printBigInt","printFunction","printFunctionName","printSymbol","replace","printError","call","printBasicValue","escapeRegex","escapeString","undefined","typeOf","isNaN","printComplexValue","config","indentation","depth","refs","hasCalledToJSON","indexOf","slice","push","hitMaxDepth","maxDepth","min","callToJSON","toJSON","printer","printListItems","printIteratorEntries","entries","printIteratorValues","values","printObjectProperties","isNewPlugin","plugin","serialize","printPlugin","printed","print","valChild","str","indentationNext","indent","edgeSpacing","spacingOuter","spacing","spacingInner","colors","error","findPlugin","plugins","p","length","test","basicResult","DEFAULT_THEME","comment","content","prop","tag","value","DEFAULT_THEME_KEYS","keys","DEFAULT_OPTIONS","highlight","Infinity","theme","validateOptions","options","forEach","key","hasOwnProperty","getColorsHighlight","reduce","color","close","open","create","getColorsEmpty","getPrintFunctionName","getEscapeRegex","getEscapeString","getConfig","createIndent","Array","join","prettyFormat","AsymmetricMatcher","ConvertAnsi","DOMCollection","DOMElement","Immutable","ReactElement","ReactTestComponent","module","exports"],"mappings":"AAAA;;AAEA,IAAIA,WAAW,GAAGC,sBAAsB,CAACC,OAAO,CAAC,aAAD,CAAR,CAAxC;;AAEA,IAAIC,YAAY,GAAGD,OAAO,CAAC,eAAD,CAA1B;;AAEA,IAAIE,kBAAkB,GAAGH,sBAAsB,CAC7CC,OAAO,CAAC,6BAAD,CADsC,CAA/C;;AAIA,IAAIG,YAAY,GAAGJ,sBAAsB,CAACC,OAAO,CAAC,uBAAD,CAAR,CAAzC;;AAEA,IAAII,cAAc,GAAGL,sBAAsB,CAACC,OAAO,CAAC,yBAAD,CAAR,CAA3C;;AAEA,IAAIK,WAAW,GAAGN,sBAAsB,CAACC,OAAO,CAAC,sBAAD,CAAR,CAAxC;;AAEA,IAAIM,UAAU,GAAGP,sBAAsB,CAACC,OAAO,CAAC,qBAAD,CAAR,CAAvC;;AAEA,IAAIO,aAAa,GAAGR,sBAAsB,CAACC,OAAO,CAAC,wBAAD,CAAR,CAA1C;;AAEA,IAAIQ,mBAAmB,GAAGT,sBAAsB,CAC9CC,OAAO,CAAC,8BAAD,CADuC,CAAhD;;AAIA,SAASD,sBAAT,CAAgCU,GAAhC,EAAqC;AACnC,SAAOA,GAAG,IAAIA,GAAG,CAACC,UAAX,GAAwBD,GAAxB,GAA8B;AAACE,IAAAA,OAAO,EAAEF;AAAV,GAArC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AACA,MAAMG,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A9B,EAAiC,EAAjC,CAAxB;AACD;;AAEDkB,YAAY,CAACpC,OAAb,GAAuB;AACrBqC,EAAAA,iBAAiB,EAAE3H,kBAAkB,CAACS,OADjB;AAErBmH,EAAAA,WAAW,EAAE3H,YAAY,CAACQ,OAFL;AAGrBoH,EAAAA,aAAa,EAAE3H,cAAc,CAACO,OAHT;AAIrBqH,EAAAA,UAAU,EAAE3H,WAAW,CAACM,OAJH;AAKrBsH,EAAAA,SAAS,EAAE3H,UAAU,CAACK,OALD;AAMrBuH,EAAAA,YAAY,EAAE3H,aAAa,CAACI,OANP;AAOrBwH,EAAAA,kBAAkB,EAAE3H,mBAAmB,CAACG;AAPnB,CAAvB;AASAyH,MAAM,CAACC,OAAP,GAAiBT,YAAjB","sourcesContent":["'use strict';\n\nvar _ansiStyles = _interopRequireDefault(require('ansi-styles'));\n\nvar _collections = require('./collections');\n\nvar _AsymmetricMatcher = _interopRequireDefault(\n require('./plugins/AsymmetricMatcher')\n);\n\nvar _ConvertAnsi = _interopRequireDefault(require('./plugins/ConvertAnsi'));\n\nvar _DOMCollection = _interopRequireDefault(require('./plugins/DOMCollection'));\n\nvar _DOMElement = _interopRequireDefault(require('./plugins/DOMElement'));\n\nvar _Immutable = _interopRequireDefault(require('./plugins/Immutable'));\n\nvar _ReactElement = _interopRequireDefault(require('./plugins/ReactElement'));\n\nvar _ReactTestComponent = _interopRequireDefault(\n require('./plugins/ReactTestComponent')\n);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {default: obj};\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable local/ban-types-eventually */\nconst toString = Object.prototype.toString;\nconst toISOString = Date.prototype.toISOString;\nconst errorToString = Error.prototype.toString;\nconst regExpToString = RegExp.prototype.toString;\n/**\n * Explicitly comparing typeof constructor to function avoids undefined as name\n * when mock identity-obj-proxy returns the key as the value for any key.\n */\n\nconst getConstructorName = val =>\n (typeof val.constructor === 'function' && val.constructor.name) || 'Object';\n/* global window */\n\n/** Is val is equal to global window object? Works even if it does not exist :) */\n\nconst isWindow = val => typeof window !== 'undefined' && val === window;\n\nconst SYMBOL_REGEXP = /^Symbol\\((.*)\\)(.*)$/;\nconst NEWLINE_REGEXP = /\\n/gi;\n\nclass PrettyFormatPluginError extends Error {\n constructor(message, stack) {\n super(message);\n this.stack = stack;\n this.name = this.constructor.name;\n }\n}\n\nfunction isToStringedArrayType(toStringed) {\n return (\n toStringed === '[object Array]' ||\n toStringed === '[object ArrayBuffer]' ||\n toStringed === '[object DataView]' ||\n toStringed === '[object Float32Array]' ||\n toStringed === '[object Float64Array]' ||\n toStringed === '[object Int8Array]' ||\n toStringed === '[object Int16Array]' ||\n toStringed === '[object Int32Array]' ||\n toStringed === '[object Uint8Array]' ||\n toStringed === '[object Uint8ClampedArray]' ||\n toStringed === '[object Uint16Array]' ||\n toStringed === '[object Uint32Array]'\n );\n}\n\nfunction printNumber(val) {\n return Object.is(val, -0) ? '-0' : String(val);\n}\n\nfunction printBigInt(val) {\n return String(`${val}n`);\n}\n\nfunction printFunction(val, printFunctionName) {\n if (!printFunctionName) {\n return '[Function]';\n }\n\n return '[Function ' + (val.name || 'anonymous') + ']';\n}\n\nfunction printSymbol(val) {\n return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');\n}\n\nfunction printError(val) {\n return '[' + errorToString.call(val) + ']';\n}\n/**\n * The first port of call for printing an object, handles most of the\n * data-types in JS.\n */\n\nfunction printBasicValue(val, printFunctionName, escapeRegex, escapeString) {\n if (val === true || val === false) {\n return '' + val;\n }\n\n if (val === undefined) {\n return 'undefined';\n }\n\n if (val === null) {\n return 'null';\n }\n\n const typeOf = typeof val;\n\n if (typeOf === 'number') {\n return printNumber(val);\n }\n\n if (typeOf === 'bigint') {\n return printBigInt(val);\n }\n\n if (typeOf === 'string') {\n if (escapeString) {\n return '\"' + val.replace(/\"|\\\\/g, '\\\\$&') + '\"';\n }\n\n return '\"' + val + '\"';\n }\n\n if (typeOf === 'function') {\n return printFunction(val, printFunctionName);\n }\n\n if (typeOf === 'symbol') {\n return printSymbol(val);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object WeakMap]') {\n return 'WeakMap {}';\n }\n\n if (toStringed === '[object WeakSet]') {\n return 'WeakSet {}';\n }\n\n if (\n toStringed === '[object Function]' ||\n toStringed === '[object GeneratorFunction]'\n ) {\n return printFunction(val, printFunctionName);\n }\n\n if (toStringed === '[object Symbol]') {\n return printSymbol(val);\n }\n\n if (toStringed === '[object Date]') {\n return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);\n }\n\n if (toStringed === '[object Error]') {\n return printError(val);\n }\n\n if (toStringed === '[object RegExp]') {\n if (escapeRegex) {\n // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js\n return regExpToString.call(val).replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n return regExpToString.call(val);\n }\n\n if (val instanceof Error) {\n return printError(val);\n }\n\n return null;\n}\n/**\n * Handles more complex objects ( such as objects with circular references.\n * maps and sets etc )\n */\n\nfunction printComplexValue(\n val,\n config,\n indentation,\n depth,\n refs,\n hasCalledToJSON\n) {\n if (refs.indexOf(val) !== -1) {\n return '[Circular]';\n }\n\n refs = refs.slice();\n refs.push(val);\n const hitMaxDepth = ++depth > config.maxDepth;\n const min = config.min;\n\n if (\n config.callToJSON &&\n !hitMaxDepth &&\n val.toJSON &&\n typeof val.toJSON === 'function' &&\n !hasCalledToJSON\n ) {\n return printer(val.toJSON(), config, indentation, depth, refs, true);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object Arguments]') {\n return hitMaxDepth\n ? '[Arguments]'\n : (min ? '' : 'Arguments ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (isToStringedArrayType(toStringed)) {\n return hitMaxDepth\n ? '[' + val.constructor.name + ']'\n : (min ? '' : val.constructor.name + ' ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (toStringed === '[object Map]') {\n return hitMaxDepth\n ? '[Map]'\n : 'Map {' +\n (0, _collections.printIteratorEntries)(\n val.entries(),\n config,\n indentation,\n depth,\n refs,\n printer,\n ' => '\n ) +\n '}';\n }\n\n if (toStringed === '[object Set]') {\n return hitMaxDepth\n ? '[Set]'\n : 'Set {' +\n (0, _collections.printIteratorValues)(\n val.values(),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n } // Avoid failure to serialize global window object in jsdom test environment.\n // For example, not even relevant if window is prop of React element.\n\n return hitMaxDepth || isWindow(val)\n ? '[' + getConstructorName(val) + ']'\n : (min ? '' : getConstructorName(val) + ' ') +\n '{' +\n (0, _collections.printObjectProperties)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n}\n\nfunction isNewPlugin(plugin) {\n return plugin.serialize != null;\n}\n\nfunction printPlugin(plugin, val, config, indentation, depth, refs) {\n let printed;\n\n try {\n printed = isNewPlugin(plugin)\n ? plugin.serialize(val, config, indentation, depth, refs, printer)\n : plugin.print(\n val,\n valChild => printer(valChild, config, indentation, depth, refs),\n str => {\n const indentationNext = indentation + config.indent;\n return (\n indentationNext +\n str.replace(NEWLINE_REGEXP, '\\n' + indentationNext)\n );\n },\n {\n edgeSpacing: config.spacingOuter,\n min: config.min,\n spacing: config.spacingInner\n },\n config.colors\n );\n } catch (error) {\n throw new PrettyFormatPluginError(error.message, error.stack);\n }\n\n if (typeof printed !== 'string') {\n throw new Error(\n `pretty-format: Plugin must return type \"string\" but instead returned \"${typeof printed}\".`\n );\n }\n\n return printed;\n}\n\nfunction findPlugin(plugins, val) {\n for (let p = 0; p < plugins.length; p++) {\n try {\n if (plugins[p].test(val)) {\n return plugins[p];\n }\n } catch (error) {\n throw new PrettyFormatPluginError(error.message, error.stack);\n }\n }\n\n return null;\n}\n\nfunction printer(val, config, indentation, depth, refs, hasCalledToJSON) {\n const plugin = findPlugin(config.plugins, val);\n\n if (plugin !== null) {\n return printPlugin(plugin, val, config, indentation, depth, refs);\n }\n\n const basicResult = printBasicValue(\n val,\n config.printFunctionName,\n config.escapeRegex,\n config.escapeString\n );\n\n if (basicResult !== null) {\n return basicResult;\n }\n\n return printComplexValue(\n val,\n config,\n indentation,\n depth,\n refs,\n hasCalledToJSON\n );\n}\n\nconst DEFAULT_THEME = {\n comment: 'gray',\n content: 'reset',\n prop: 'yellow',\n tag: 'cyan',\n value: 'green'\n};\nconst DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);\nconst DEFAULT_OPTIONS = {\n callToJSON: true,\n escapeRegex: false,\n escapeString: true,\n highlight: false,\n indent: 2,\n maxDepth: Infinity,\n min: false,\n plugins: [],\n printFunctionName: true,\n theme: DEFAULT_THEME\n};\n\nfunction validateOptions(options) {\n Object.keys(options).forEach(key => {\n if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {\n throw new Error(`pretty-format: Unknown option \"${key}\".`);\n }\n });\n\n if (options.min && options.indent !== undefined && options.indent !== 0) {\n throw new Error(\n 'pretty-format: Options \"min\" and \"indent\" cannot be used together.'\n );\n }\n\n if (options.theme !== undefined) {\n if (options.theme === null) {\n throw new Error(`pretty-format: Option \"theme\" must not be null.`);\n }\n\n if (typeof options.theme !== 'object') {\n throw new Error(\n `pretty-format: Option \"theme\" must be of type \"object\" but instead received \"${typeof options.theme}\".`\n );\n }\n }\n}\n\nconst getColorsHighlight = options =>\n DEFAULT_THEME_KEYS.reduce((colors, key) => {\n const value =\n options.theme && options.theme[key] !== undefined\n ? options.theme[key]\n : DEFAULT_THEME[key];\n const color = value && _ansiStyles.default[value];\n\n if (\n color &&\n typeof color.close === 'string' &&\n typeof color.open === 'string'\n ) {\n colors[key] = color;\n } else {\n throw new Error(\n `pretty-format: Option \"theme\" has a key \"${key}\" whose value \"${value}\" is undefined in ansi-styles.`\n );\n }\n\n return colors;\n }, Object.create(null));\n\nconst getColorsEmpty = () =>\n DEFAULT_THEME_KEYS.reduce((colors, key) => {\n colors[key] = {\n close: '',\n open: ''\n };\n return colors;\n }, Object.create(null));\n\nconst getPrintFunctionName = options =>\n options && options.printFunctionName !== undefined\n ? options.printFunctionName\n : DEFAULT_OPTIONS.printFunctionName;\n\nconst getEscapeRegex = options =>\n options && options.escapeRegex !== undefined\n ? options.escapeRegex\n : DEFAULT_OPTIONS.escapeRegex;\n\nconst getEscapeString = options =>\n options && options.escapeString !== undefined\n ? options.escapeString\n : DEFAULT_OPTIONS.escapeString;\n\nconst getConfig = options => ({\n callToJSON:\n options && options.callToJSON !== undefined\n ? options.callToJSON\n : DEFAULT_OPTIONS.callToJSON,\n colors:\n options && options.highlight\n ? getColorsHighlight(options)\n : getColorsEmpty(),\n escapeRegex: getEscapeRegex(options),\n escapeString: getEscapeString(options),\n indent:\n options && options.min\n ? ''\n : createIndent(\n options && options.indent !== undefined\n ? options.indent\n : DEFAULT_OPTIONS.indent\n ),\n maxDepth:\n options && options.maxDepth !== undefined\n ? options.maxDepth\n : DEFAULT_OPTIONS.maxDepth,\n min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,\n plugins:\n options && options.plugins !== undefined\n ? options.plugins\n : DEFAULT_OPTIONS.plugins,\n printFunctionName: getPrintFunctionName(options),\n spacingInner: options && options.min ? ' ' : '\\n',\n spacingOuter: options && options.min ? '' : '\\n'\n});\n\nfunction createIndent(indent) {\n return new Array(indent + 1).join(' ');\n}\n/**\n * Returns a presentation string of your `val` object\n * @param val any potential JavaScript object\n * @param options Custom settings\n */\n\nfunction prettyFormat(val, options) {\n if (options) {\n validateOptions(options);\n\n if (options.plugins) {\n const plugin = findPlugin(options.plugins, val);\n\n if (plugin !== null) {\n return printPlugin(plugin, val, getConfig(options), '', 0, []);\n }\n }\n }\n\n const basicResult = printBasicValue(\n val,\n getPrintFunctionName(options),\n getEscapeRegex(options),\n getEscapeString(options)\n );\n\n if (basicResult !== null) {\n return basicResult;\n }\n\n return printComplexValue(val, getConfig(options), '', 0, []);\n}\n\nprettyFormat.plugins = {\n AsymmetricMatcher: _AsymmetricMatcher.default,\n ConvertAnsi: _ConvertAnsi.default,\n DOMCollection: _DOMCollection.default,\n DOMElement: _DOMElement.default,\n Immutable: _Immutable.default,\n ReactElement: _ReactElement.default,\n ReactTestComponent: _ReactTestComponent.default\n};\nmodule.exports = prettyFormat;\n"]},"metadata":{},"sourceType":"script"}
|