@vitest/utils
Advanced tools
Comparing version 0.34.4 to 0.34.5
@@ -1,2 +0,4 @@ | ||
import { CompareKeys } from 'pretty-format'; | ||
import { D as DiffOptions } from './types-f5c02aaf.js'; | ||
export { a as DiffOptionsColor } from './types-f5c02aaf.js'; | ||
import 'pretty-format'; | ||
@@ -62,31 +64,2 @@ /** | ||
type DiffOptionsColor = (arg: string) => string; | ||
interface DiffOptions { | ||
aAnnotation?: string; | ||
aColor?: DiffOptionsColor; | ||
aIndicator?: string; | ||
bAnnotation?: string; | ||
bColor?: DiffOptionsColor; | ||
bIndicator?: string; | ||
changeColor?: DiffOptionsColor; | ||
changeLineTrailingSpaceColor?: DiffOptionsColor; | ||
commonColor?: DiffOptionsColor; | ||
commonIndicator?: string; | ||
commonLineTrailingSpaceColor?: DiffOptionsColor; | ||
contextLines?: number; | ||
emptyFirstOrLastLinePlaceholder?: string; | ||
expand?: boolean; | ||
includeChangeCounts?: boolean; | ||
omitAnnotationLines?: boolean; | ||
patchColor?: DiffOptionsColor; | ||
compareKeys?: CompareKeys; | ||
} | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
declare function diffLinesUnified(aLines: Array<string>, bLines: Array<string>, options?: DiffOptions): string; | ||
@@ -121,2 +94,2 @@ declare function diffLinesUnified2(aLinesDisplay: Array<string>, bLinesDisplay: Array<string>, aLinesCompare: Array<string>, bLinesCompare: Array<string>, options?: DiffOptions): string; | ||
export { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff, DiffOptions, DiffOptionsColor, diff, diffLinesRaw, diffLinesUnified, diffLinesUnified2, diffStringsRaw, diffStringsUnified }; | ||
export { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff, DiffOptions, diff, diffLinesRaw, diffLinesUnified, diffLinesUnified2, diffStringsRaw, diffStringsUnified }; |
@@ -0,3 +1,6 @@ | ||
import { D as DiffOptions } from './types-f5c02aaf.js'; | ||
import 'pretty-format'; | ||
declare function serializeError(val: any, seen?: WeakMap<object, any>): any; | ||
declare function processError(err: any): any; | ||
declare function processError(err: any, diffOptions?: DiffOptions): any; | ||
declare function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced?: WeakSet<object>, expectedReplaced?: WeakSet<object>): { | ||
@@ -4,0 +7,0 @@ replacedActual: any; |
@@ -75,3 +75,3 @@ import { diff } from './diff.js'; | ||
} | ||
function processError(err) { | ||
function processError(err, diffOptions) { | ||
if (!err || typeof err !== "object") | ||
@@ -87,3 +87,3 @@ return { message: err }; | ||
const { replacedActual, replacedExpected } = replaceAsymmetricMatcher(clonedActual, clonedExpected); | ||
err.diff = diff(replacedExpected, replacedActual); | ||
err.diff = diff(replacedExpected, replacedActual, diffOptions); | ||
} | ||
@@ -90,0 +90,0 @@ if (typeof err.expected !== "string") |
{ | ||
"name": "@vitest/utils", | ||
"type": "module", | ||
"version": "0.34.4", | ||
"version": "0.34.5", | ||
"description": "Shared Vitest utility functions", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
109709
21
3043