pretty-format
Advanced tools
Comparing version 28.0.0-alpha.3 to 28.0.0-alpha.4
@@ -7,50 +7,5 @@ /** | ||
*/ | ||
import type {SnapshotFormat} from '@jest/schemas'; | ||
export declare type Colors = { | ||
comment: { | ||
close: string; | ||
open: string; | ||
}; | ||
content: { | ||
close: string; | ||
open: string; | ||
}; | ||
prop: { | ||
close: string; | ||
open: string; | ||
}; | ||
tag: { | ||
close: string; | ||
open: string; | ||
}; | ||
value: { | ||
close: string; | ||
open: string; | ||
}; | ||
}; | ||
export declare type CompareKeys = | ||
| ((a: string, b: string) => number) | ||
| undefined; | ||
export declare type Config = { | ||
callToJSON: boolean; | ||
compareKeys: CompareKeys; | ||
colors: Colors; | ||
escapeRegex: boolean; | ||
escapeString: boolean; | ||
indent: string; | ||
maxDepth: number; | ||
maxWidth: number; | ||
min: boolean; | ||
plugins: Plugins; | ||
printBasicPrototype: boolean; | ||
printFunctionName: boolean; | ||
spacingInner: string; | ||
spacingOuter: string; | ||
}; | ||
import type { NewPlugin, Options, OptionsReceived } from './types'; | ||
export type { Colors, CompareKeys, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, PrettyFormatOptions, Printer, Refs, Theme, } from './types'; | ||
export declare const DEFAULT_OPTIONS: Options; | ||
/** | ||
@@ -61,84 +16,12 @@ * Returns a presentation string of your `val` object | ||
*/ | ||
declare function format(val: unknown, options?: OptionsReceived): string; | ||
export default format; | ||
export {format}; | ||
declare type Indent = (arg0: string) => string; | ||
export declare type NewPlugin = { | ||
serialize: ( | ||
val: any, | ||
config: Config, | ||
indentation: string, | ||
depth: number, | ||
refs: Refs, | ||
printer: Printer, | ||
) => string; | ||
test: Test; | ||
}; | ||
export declare type OldPlugin = { | ||
print: ( | ||
val: unknown, | ||
print: Print, | ||
indent: Indent, | ||
options: PluginOptions, | ||
colors: Colors, | ||
) => string; | ||
test: Test; | ||
}; | ||
export declare interface Options | ||
extends Omit<RequiredOptions, 'compareKeys' | 'theme'> { | ||
compareKeys: CompareKeys; | ||
theme: Required<RequiredOptions['theme']>; | ||
} | ||
export declare type OptionsReceived = PrettyFormatOptions; | ||
declare type Plugin_2 = NewPlugin | OldPlugin; | ||
export {Plugin_2 as Plugin}; | ||
declare type PluginOptions = { | ||
edgeSpacing: string; | ||
min: boolean; | ||
spacing: string; | ||
}; | ||
export declare type Plugins = Array<Plugin_2>; | ||
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; | ||
AsymmetricMatcher: NewPlugin; | ||
ConvertAnsi: NewPlugin; | ||
DOMCollection: NewPlugin; | ||
DOMElement: NewPlugin; | ||
Immutable: NewPlugin; | ||
ReactElement: NewPlugin; | ||
ReactTestComponent: NewPlugin; | ||
}; | ||
export declare interface PrettyFormatOptions extends SnapshotFormat { | ||
compareKeys?: CompareKeys; | ||
plugins?: Plugins; | ||
} | ||
declare type Print = (arg0: unknown) => string; | ||
export declare type Printer = ( | ||
val: unknown, | ||
config: Config, | ||
indentation: string, | ||
depth: number, | ||
refs: Refs, | ||
hasCalledToJSON?: boolean, | ||
) => string; | ||
export declare type Refs = Array<unknown>; | ||
declare type RequiredOptions = Required<PrettyFormatOptions>; | ||
declare type Test = (arg0: any) => boolean; | ||
export declare type Theme = Options['theme']; | ||
export {}; | ||
export default format; |
@@ -430,3 +430,3 @@ 'use strict'; | ||
Object.keys(options).forEach(key => { | ||
if (!DEFAULT_OPTIONS.hasOwnProperty(key)) { | ||
if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key)) { | ||
throw new Error(`pretty-format: Unknown option "${key}".`); | ||
@@ -433,0 +433,0 @@ } |
@@ -10,17 +10,3 @@ 'use strict'; | ||
var global = (function () { | ||
if (typeof globalThis !== 'undefined') { | ||
return globalThis; | ||
} else if (typeof global !== 'undefined') { | ||
return global; | ||
} else if (typeof self !== 'undefined') { | ||
return self; | ||
} else if (typeof window !== 'undefined') { | ||
return window; | ||
} else { | ||
return Function('return this')(); | ||
} | ||
})(); | ||
var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol; | ||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; | ||
const asymmetricMatcher = | ||
@@ -27,0 +13,0 @@ typeof Symbol === 'function' && Symbol.for |
@@ -10,17 +10,3 @@ 'use strict'; | ||
var global = (function () { | ||
if (typeof globalThis !== 'undefined') { | ||
return globalThis; | ||
} else if (typeof global !== 'undefined') { | ||
return global; | ||
} else if (typeof self !== 'undefined') { | ||
return self; | ||
} else if (typeof window !== 'undefined') { | ||
return window; | ||
} else { | ||
return Function('return this')(); | ||
} | ||
})(); | ||
var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol; | ||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; | ||
const testSymbol = | ||
@@ -27,0 +13,0 @@ typeof Symbol === 'function' && Symbol.for |
{ | ||
"name": "pretty-format", | ||
"version": "28.0.0-alpha.3", | ||
"version": "28.0.0-alpha.4", | ||
"repository": { | ||
@@ -33,3 +33,3 @@ "type": "git", | ||
"immutable": "^4.0.0", | ||
"jest-util": "^28.0.0-alpha.3", | ||
"jest-util": "^28.0.0-alpha.4", | ||
"react": "*", | ||
@@ -45,3 +45,3 @@ "react-dom": "*", | ||
}, | ||
"gitHead": "fc30b27bd94bb7ebeaadc72626ebbdba535150d2" | ||
"gitHead": "c13dab19491ba6b57c2d703e7d7c4b20189e1e17" | ||
} |
@@ -221,4 +221,4 @@ # pretty-format | ||
| `printFunctionName` | `boolean` | include or omit the name of a function | | ||
| `spacingInner` | `strong` | spacing to separate items in a list | | ||
| `spacingOuter` | `strong` | spacing to enclose a list of items | | ||
| `spacingInner` | `string` | spacing to separate items in a list | | ||
| `spacingOuter` | `string` | spacing to enclose a list of items | | ||
@@ -225,0 +225,0 @@ Each property of `colors` in `config` corresponds to a property of `theme` in `options`: |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
70679
26
1869
0