Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-mock-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-mock-dev-server - npm Package Compare versions

Comparing version 0.3.9 to 0.3.10

17

dist/index.js

@@ -290,2 +290,3 @@ // src/mockMiddleware.ts

import bodyParser from "co-body";
import formidable from "formidable";
async function parseReqBody(req) {

@@ -305,4 +306,20 @@ const method = req.method.toUpperCase();

}
if (type == null ? void 0 : type.startsWith("multipart/form-data;")) {
return await parseMultipart(req);
}
return void 0;
}
async function parseMultipart(req) {
const form = formidable({ multiples: true });
debug("multiparty start");
return new Promise((resolve, reject) => {
form.parse(req, (error, fields, files) => {
if (error) {
reject(error);
return;
}
resolve({ ...fields, ...files });
});
});
}

@@ -309,0 +326,0 @@ // src/validator.ts

4

package.json
{
"name": "vite-plugin-mock-dev-server",
"version": "0.3.9",
"version": "0.3.10",
"keywords": [

@@ -52,2 +52,3 @@ "vite",

"fast-glob": "^3.2.12",
"formidable": "^2.1.1",
"json5": "^2.2.2",

@@ -61,2 +62,3 @@ "path-to-regexp": "^6.2.1"

"@types/debug": "^4.1.7",
"@types/formidable": "^2.0.5",
"@types/node": "^18.11.7",

@@ -63,0 +65,0 @@ "bumpp": "^8.2.1",

@@ -36,3 +36,3 @@ # vite-plugin-mock-dev-server

- 🍕 Support `viteConfig.define` in mock file
- 📤 Support `multipart` content-type,mock upload file.
## Documentation

@@ -39,0 +39,0 @@

@@ -37,2 +37,3 @@ # vite-plugin-mock-dev-server

- 🍕 支持在 mock文件中使用 `viteConfig.define`配置字段
- 📤 支持 multipart 类型,模拟文件上传

@@ -39,0 +40,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc