@vitest/snapshot
Advanced tools
+8
-0
@@ -288,2 +288,4 @@ import { resolve } from 'pathe'; | ||
| ]; | ||
| const NOW_LENGTH = Date.now().toString().length; | ||
| const REGEXP_VITEST = new RegExp(`vitest=\\d{${NOW_LENGTH}}`); | ||
| function extractLocation(urlLike) { | ||
@@ -313,2 +315,5 @@ // Fail-fast but return locations like "(native)" | ||
| } | ||
| if (url.includes("vitest=")) { | ||
| url = url.replace(REGEXP_VITEST, "").replace(/[?&]$/, ""); | ||
| } | ||
| return [ | ||
@@ -551,2 +556,5 @@ url, | ||
| const code = await environment.readSnapshotFile(file); | ||
| if (code == null) { | ||
| throw new Error(`cannot read ${file} when saving inline snapshot`); | ||
| } | ||
| const s = new MagicString(code); | ||
@@ -553,0 +561,0 @@ for (const snap of snaps) { |
+3
-3
| { | ||
| "name": "@vitest/snapshot", | ||
| "type": "module", | ||
| "version": "4.1.0-beta.1", | ||
| "version": "4.1.0-beta.2", | ||
| "description": "Vitest snapshot manager", | ||
@@ -43,3 +43,3 @@ "license": "MIT", | ||
| "pathe": "^2.0.3", | ||
| "@vitest/pretty-format": "4.1.0-beta.1" | ||
| "@vitest/pretty-format": "4.1.0-beta.2" | ||
| }, | ||
@@ -49,3 +49,3 @@ "devDependencies": { | ||
| "natural-compare": "^1.4.0", | ||
| "@vitest/utils": "4.1.0-beta.1" | ||
| "@vitest/utils": "4.1.0-beta.2" | ||
| }, | ||
@@ -52,0 +52,0 @@ "scripts": { |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
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
63032
0.49%1757
0.46%21
Infinity%+ Added
- Removed