@vitest/utils
Advanced tools
Comparing version 0.34.1 to 0.34.2
import { diff } from './diff.js'; | ||
import { f as format, s as stringify } from './chunk-display.js'; | ||
import { getOwnProperties, getType } from './helpers.js'; | ||
import { deepClone, getOwnProperties, getType } from './helpers.js'; | ||
import 'pretty-format'; | ||
@@ -82,4 +82,8 @@ import 'diff-sequences'; | ||
err.nameStr = String(err.name); | ||
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) | ||
err.diff = diff(err.expected, err.actual); | ||
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) { | ||
const clonedActual = deepClone(err.actual, { forceWritable: true }); | ||
const clonedExpected = deepClone(err.expected, { forceWritable: true }); | ||
const { replacedActual, replacedExpected } = replaceAsymmetricMatcher(clonedActual, clonedExpected); | ||
err.diff = diff(replacedExpected, replacedActual); | ||
} | ||
if (typeof err.expected !== "string") | ||
@@ -86,0 +90,0 @@ err.expected = stringify(err.expected, 10); |
@@ -35,2 +35,2 @@ import { Nullable, Arrayable } from './types.js'; | ||
export { assertTypes, clone, createDefer, deepClone, getCallLastIndex, getOwnProperties, getType, isObject, isPrimitive, noop, notNullish, objectAttr, parseRegexp, slash, toArray }; | ||
export { DeferPromise, assertTypes, clone, createDefer, deepClone, getCallLastIndex, getOwnProperties, getType, isObject, isPrimitive, noop, notNullish, objectAttr, parseRegexp, slash, toArray }; |
@@ -1,2 +0,2 @@ | ||
export { assertTypes, clone, createDefer, deepClone, getCallLastIndex, getOwnProperties, getType, isObject, isPrimitive, noop, notNullish, objectAttr, parseRegexp, slash, toArray } from './helpers.js'; | ||
export { DeferPromise, assertTypes, clone, createDefer, deepClone, getCallLastIndex, getOwnProperties, getType, isObject, isPrimitive, noop, notNullish, objectAttr, parseRegexp, slash, toArray } from './helpers.js'; | ||
export { ArgumentsType, Arrayable, Awaitable, Constructable, DeepMerge, ErrorWithDiff, MergeInsertions, MutableArray, Nullable, ParsedStack } from './types.js'; | ||
@@ -3,0 +3,0 @@ import { PrettyFormatOptions } from 'pretty-format'; |
@@ -833,2 +833,4 @@ import { notNullish, isPrimitive } from './helpers.js'; | ||
file = resolve$2(file); | ||
if (method) | ||
method = method.replace(/__vite_ssr_import_\d+__\./g, ""); | ||
return { | ||
@@ -835,0 +837,0 @@ method, |
{ | ||
"name": "@vitest/utils", | ||
"type": "module", | ||
"version": "0.34.1", | ||
"version": "0.34.2", | ||
"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
109399
3037