@vitest/utils 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-display.js +2 -2
- package/dist/error.js +1 -1
- package/package.json +2 -2
package/dist/chunk-display.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { format as format$1, plugins } from 'pretty-format';
|
2
|
-
import
|
2
|
+
import * as loupe from 'loupe';
|
3
3
|
|
4
4
|
const {
|
5
5
|
AsymmetricMatcher,
|
@@ -117,7 +117,7 @@ function format(...args) {
|
|
117
117
|
function inspect(obj, options = {}) {
|
118
118
|
if (options.truncate === 0)
|
119
119
|
options.truncate = Number.POSITIVE_INFINITY;
|
120
|
-
return inspect
|
120
|
+
return loupe.inspect(obj, options);
|
121
121
|
}
|
122
122
|
function objDisplay(obj, options = {}) {
|
123
123
|
if (typeof options.truncate === "undefined")
|
package/dist/error.js
CHANGED
@@ -110,7 +110,7 @@ function isAsymmetricMatcher(data) {
|
|
110
110
|
function isReplaceable(obj1, obj2) {
|
111
111
|
const obj1Type = getType(obj1);
|
112
112
|
const obj2Type = getType(obj2);
|
113
|
-
return obj1Type === obj2Type && obj1Type === "Object";
|
113
|
+
return obj1Type === obj2Type && (obj1Type === "Object" || obj1Type === "Array");
|
114
114
|
}
|
115
115
|
function replaceAsymmetricMatcher(actual, expected, actualReplaced = /* @__PURE__ */ new WeakSet(), expectedReplaced = /* @__PURE__ */ new WeakSet()) {
|
116
116
|
if (!isReplaceable(actual, expected))
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitest/utils",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.3.0",
|
5
5
|
"description": "Shared Vitest utility functions",
|
6
6
|
"license": "MIT",
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
@@ -63,7 +63,7 @@
|
|
63
63
|
"pretty-format": "^29.7.0"
|
64
64
|
},
|
65
65
|
"devDependencies": {
|
66
|
-
"@jridgewell/trace-mapping": "^0.3.
|
66
|
+
"@jridgewell/trace-mapping": "^0.3.22",
|
67
67
|
"@types/estree": "^1.0.5",
|
68
68
|
"tinyhighlight": "^0.3.2"
|
69
69
|
},
|