+12
-1
@@ -7,2 +7,3 @@ import { EventEmitter } from 'events'; | ||
| import { pipeline } from 'stream/promises'; | ||
| import fs from 'node:fs'; | ||
| export function isFileTransform(transform) { | ||
@@ -14,6 +15,16 @@ return (typeof transform === 'function' || | ||
| export function loadFile(filepath) { | ||
| const stat = fs.statSync(filepath, { throwIfNoEntry: false }); | ||
| if (stat?.isDirectory?.()) { | ||
| return new File({ | ||
| cwd: process.cwd(), | ||
| base: process.cwd(), | ||
| path: filepath, | ||
| stat, | ||
| contents: null, | ||
| }); | ||
| } | ||
| try { | ||
| return vinylFileSync(filepath); | ||
| } | ||
| catch (err) { | ||
| catch { | ||
| return new File({ | ||
@@ -20,0 +31,0 @@ cwd: process.cwd(), |
+9
-11
| { | ||
| "name": "mem-fs", | ||
| "version": "4.1.2", | ||
| "version": "4.1.3", | ||
| "description": "Simple in-memory vinyl file store", | ||
@@ -9,3 +9,3 @@ "type": "module", | ||
| "prepare": "tsc", | ||
| "pretest": "eslint ." | ||
| "pretest": "eslint . && prettier --check --ignore-unknown --no-error-on-unmatched-pattern ." | ||
| }, | ||
@@ -22,3 +22,3 @@ "repository": "SBoudrias/mem-fs", | ||
| "@types/node": ">=18", | ||
| "@types/vinyl": "^2.0.8", | ||
| "@types/vinyl": "^2.0.12", | ||
| "vinyl": "^3.0.0", | ||
@@ -28,12 +28,10 @@ "vinyl-file": "^5.0.0" | ||
| "devDependencies": { | ||
| "@typescript-eslint/eslint-plugin": "^6.7.4", | ||
| "@typescript-eslint/parser": "^6.7.4", | ||
| "@vitest/coverage-v8": "^0.34.6", | ||
| "eslint": "^8.50.0", | ||
| "eslint-config-prettier": "^9.0.0", | ||
| "eslint-config-xo": "^0.43.1", | ||
| "eslint-plugin-prettier": "^5.0.0", | ||
| "@vitest/coverage-v8": "^4.0.16", | ||
| "eslint": "^9.39.2", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-config-xo": "^0.49.0", | ||
| "prettier": "^3.0.3", | ||
| "typescript": "^5.2.2", | ||
| "vitest": "^0.34.6" | ||
| "typescript-eslint": "^8.32.1", | ||
| "vitest": "^4.0.16" | ||
| }, | ||
@@ -40,0 +38,0 @@ "engines": { |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
9311
3.09%8
-20%202
5.76%0
-100%Updated