pretty-format
Advanced tools
Comparing version 26.6.2 to 27.0.0-next.0
@@ -7,3 +7,4 @@ /** | ||
*/ | ||
import type * as PrettyFormat from './types'; | ||
import type { NewPlugin, OptionsReceived } from './types'; | ||
export type { Colors, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, Refs, Theme, } from './types'; | ||
/** | ||
@@ -14,26 +15,12 @@ * Returns a presentation string of your `val` object | ||
*/ | ||
declare function prettyFormat(val: unknown, options?: PrettyFormat.OptionsReceived): string; | ||
declare namespace prettyFormat { | ||
var plugins: { | ||
AsymmetricMatcher: PrettyFormat.NewPlugin; | ||
ConvertAnsi: PrettyFormat.NewPlugin; | ||
DOMCollection: PrettyFormat.NewPlugin; | ||
DOMElement: PrettyFormat.NewPlugin; | ||
Immutable: PrettyFormat.NewPlugin; | ||
ReactElement: PrettyFormat.NewPlugin; | ||
ReactTestComponent: PrettyFormat.NewPlugin; | ||
}; | ||
} | ||
declare namespace prettyFormat { | ||
type Colors = PrettyFormat.Colors; | ||
type Config = PrettyFormat.Config; | ||
type Options = PrettyFormat.Options; | ||
type OptionsReceived = PrettyFormat.OptionsReceived; | ||
type OldPlugin = PrettyFormat.OldPlugin; | ||
type NewPlugin = PrettyFormat.NewPlugin; | ||
type Plugin = PrettyFormat.Plugin; | ||
type Plugins = PrettyFormat.Plugins; | ||
type Refs = PrettyFormat.Refs; | ||
type Theme = PrettyFormat.Theme; | ||
} | ||
export = prettyFormat; | ||
export declare function format(val: unknown, options?: OptionsReceived): string; | ||
export declare const plugins: { | ||
AsymmetricMatcher: NewPlugin; | ||
ConvertAnsi: NewPlugin; | ||
DOMCollection: NewPlugin; | ||
DOMElement: NewPlugin; | ||
Immutable: NewPlugin; | ||
ReactElement: NewPlugin; | ||
ReactTestComponent: NewPlugin; | ||
}; | ||
export default format; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports.format = format; | ||
exports.default = exports.plugins = void 0; | ||
var _ansiStyles = _interopRequireDefault(require('ansi-styles')); | ||
@@ -524,3 +530,3 @@ | ||
function prettyFormat(val, options) { | ||
function format(val, options) { | ||
if (options) { | ||
@@ -552,3 +558,3 @@ validateOptions(options); | ||
prettyFormat.plugins = { | ||
const plugins = { | ||
AsymmetricMatcher: _AsymmetricMatcher.default, | ||
@@ -562,2 +568,4 @@ ConvertAnsi: _ConvertAnsi.default, | ||
}; | ||
module.exports = prettyFormat; | ||
exports.plugins = plugins; | ||
var _default = format; | ||
exports.default = _default; |
{ | ||
"name": "pretty-format", | ||
"version": "26.6.2", | ||
"version": "27.0.0-next.0", | ||
"repository": { | ||
@@ -11,9 +11,13 @@ "type": "git", | ||
"description": "Stringify any JavaScript value.", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"exports": { | ||
".": "./build/index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"author": "James Kyle <me@thejameskyle.com>", | ||
"dependencies": { | ||
"@jest/types": "^26.6.2", | ||
"@jest/types": "^27.0.0-next.0", | ||
"ansi-regex": "^5.0.0", | ||
"ansi-styles": "^4.0.0", | ||
"ansi-styles": "^5.0.0", | ||
"react-is": "^17.0.1" | ||
@@ -23,6 +27,6 @@ }, | ||
"@types/react": "*", | ||
"@types/react-is": "^16.7.1", | ||
"@types/react-is": "^17.0.0", | ||
"@types/react-test-renderer": "*", | ||
"immutable": "4.0.0-rc.9", | ||
"jest-util": "^26.6.2", | ||
"jest-util": "^27.0.0-next.0", | ||
"react": "*", | ||
@@ -33,3 +37,3 @@ "react-dom": "*", | ||
"engines": { | ||
"node": ">= 10" | ||
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" | ||
}, | ||
@@ -39,3 +43,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5" | ||
"gitHead": "4f77c70602cab8419794f10fa39510f13baafef8" | ||
} |
@@ -17,7 +17,7 @@ # pretty-format | ||
```js | ||
const prettyFormat = require('pretty-format'); // CommonJS | ||
const {format: prettyFormat} = require('pretty-format'); // CommonJS | ||
``` | ||
```js | ||
import prettyFormat from 'pretty-format'; // ES2015 modules | ||
import {format as prettyFormat} from 'pretty-format'; // ES2015 modules | ||
``` | ||
@@ -106,13 +106,14 @@ | ||
const renderer = require('react-test-renderer'); | ||
const prettyFormat = require('pretty-format'); | ||
const ReactElement = prettyFormat.plugins.ReactElement; | ||
const ReactTestComponent = prettyFormat.plugins.ReactTestComponent; | ||
const {format: prettyFormat, plugins} = require('pretty-format'); | ||
const {ReactElement, ReactTestComponent} = plugins; | ||
``` | ||
```js | ||
// ES2015 modules and destructuring assignment | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
// ES2015 modules and destructuring assignment | ||
import prettyFormat from 'pretty-format'; | ||
const {ReactElement, ReactTestComponent} = prettyFormat.plugins; | ||
import {plugins, format as prettyFormat} from 'pretty-format'; | ||
const {ReactElement, ReactTestComponent} = plugins; | ||
``` | ||
@@ -119,0 +120,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
456
67390
1802
2
+ Added@jest/types@27.5.1(transitive)
+ Added@types/yargs@16.0.9(transitive)
+ Addedansi-styles@5.2.0(transitive)
- Removed@jest/types@26.6.2(transitive)
- Removed@types/yargs@15.0.19(transitive)
Updated@jest/types@^27.0.0-next.0
Updatedansi-styles@^5.0.0