@vitest/utils
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -100,3 +100,3 @@ import { printDiffOrStringify } from './diff.js'; | ||
} | ||
if (err.showDiff || err.showDiff === void 0 && err.expected !== void 0 && err.actual !== void 0) { | ||
if (err.showDiff || err.showDiff === undefined && err.expected !== undefined && err.actual !== undefined) { | ||
err.diff = printDiffOrStringify(err.actual, err.expected, { | ||
@@ -131,4 +131,4 @@ ...diffOptions, | ||
new Error( | ||
`Failed to fully serialize error: ${e == null ? void 0 : e.message} | ||
Inner error message: ${err == null ? void 0 : err.message}` | ||
`Failed to fully serialize error: ${e == null ? undefined : e.message} | ||
Inner error message: ${err == null ? undefined : err.message}` | ||
) | ||
@@ -135,0 +135,0 @@ ); |
@@ -42,3 +42,3 @@ function createSimpleStackTrace(options) { | ||
function toArray(array) { | ||
if (array === null || array === void 0) { | ||
if (array === null || array === undefined) { | ||
array = []; | ||
@@ -128,3 +128,3 @@ } | ||
} | ||
function objectAttr(source, path, defaultValue = void 0) { | ||
function objectAttr(source, path, defaultValue = undefined) { | ||
const paths = path.replace(/\[(\d+)\]/g, ".$1").split("."); | ||
@@ -134,3 +134,3 @@ let result = source; | ||
result = new Object(result)[p]; | ||
if (result === void 0) { | ||
if (result === undefined) { | ||
return defaultValue; | ||
@@ -208,3 +208,3 @@ } | ||
const source = sources.shift(); | ||
if (source === void 0) { | ||
if (source === undefined) { | ||
return target; | ||
@@ -211,0 +211,0 @@ } |
@@ -63,3 +63,3 @@ import { g as getDefaultExportFromCjs } from './chunk-_commonjsHelpers.js'; | ||
value: match[0], | ||
closed: match[1] !== void 0 && match[1] !== "\\" | ||
closed: match[1] !== undefined && match[1] !== "\\" | ||
}); | ||
@@ -202,3 +202,3 @@ continue; | ||
value: match[0], | ||
closed: match[2] !== void 0 | ||
closed: match[2] !== undefined | ||
}); | ||
@@ -304,3 +304,3 @@ continue; | ||
value: match[0], | ||
closed: match[2] !== void 0 | ||
closed: match[2] !== undefined | ||
}); | ||
@@ -380,3 +380,3 @@ continue; | ||
value: match[0], | ||
closed: match[1] !== void 0 | ||
closed: match[1] !== undefined | ||
}); | ||
@@ -404,3 +404,3 @@ continue; | ||
} | ||
return void 0; | ||
return undefined; | ||
}; | ||
@@ -512,3 +512,3 @@ return jsTokens_1; | ||
}; | ||
function highlight$1(code, options = { jsx: !1, colors: {} }) { | ||
function highlight$1(code, options = { jsx: false, colors: {} }) { | ||
return code && highlightTokens(options.colors || {}, code, options.jsx); | ||
@@ -515,0 +515,0 @@ } |
@@ -25,3 +25,3 @@ import { notNullish, isPrimitive } from './helpers.js'; | ||
if (shouldNegate) { | ||
value = -0x80000000 | -value; | ||
value = -2147483648 | -value; | ||
} | ||
@@ -729,3 +729,2 @@ return relative + value; | ||
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/; | ||
globalThis.process?.platform === "win32" ? ";" : ":"; | ||
function cwd() { | ||
@@ -862,3 +861,3 @@ if (typeof process !== "undefined" && typeof process.cwd === "function") { | ||
} | ||
return [url, parts[2] || void 0, parts[3] || void 0]; | ||
return [url, parts[2] || undefined, parts[3] || undefined]; | ||
} | ||
@@ -881,3 +880,3 @@ function parseSingleFFOrSafariStack(raw) { | ||
const matches = line.match(functionNameRegex); | ||
const functionName = matches && matches[1] ? matches[1] : void 0; | ||
const functionName = matches && matches[1] ? matches[1] : undefined; | ||
const [url, lineNumber, columnNumber] = extractLocation( | ||
@@ -918,3 +917,3 @@ line.replace(functionNameRegex, "") | ||
let method = location && sanitizedLine || ""; | ||
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url; | ||
let file = url && ["eval", "<anonymous>"].includes(url) ? undefined : url; | ||
if (!file || !lineNumber || !columnNumber) { | ||
@@ -962,3 +961,3 @@ return null; | ||
} | ||
const map = (_a = options.getSourceMap) == null ? void 0 : _a.call(options, stack2.file); | ||
const map = (_a = options.getSourceMap) == null ? undefined : _a.call(options, stack2.file); | ||
if (!map || typeof map !== "object" || !map.version) { | ||
@@ -965,0 +964,0 @@ return stack2; |
{ | ||
"name": "@vitest/utils", | ||
"type": "module", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Shared Vitest utility functions", | ||
@@ -65,3 +65,3 @@ "license": "MIT", | ||
"tinyrainbow": "^2.0.0", | ||
"@vitest/pretty-format": "3.0.0" | ||
"@vitest/pretty-format": "3.0.1" | ||
}, | ||
@@ -68,0 +68,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
159957
12
4572
+ Added@vitest/pretty-format@3.0.1(transitive)
- Removed@vitest/pretty-format@3.0.0(transitive)
Updated@vitest/pretty-format@3.0.1