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

mp-network

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mp-network - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

dist/index.d.ts

@@ -404,3 +404,3 @@ declare type HeaderValue = string | string[] | number | boolean | null;

interface Download {
(url: string, filePath: string, options: Omit<DownloadRequestOptions, 'filePath'>): DownloadPromise;
(url: string, filePath?: string, options?: Omit<DownloadRequestOptions, 'filePath'>): DownloadPromise;
}

@@ -407,0 +407,0 @@ declare function createDownload(uploadOptions?: Partial<DownloadRequestOptions>): Download;

@@ -273,3 +273,3 @@ // src/utils/is.ts

function createDownload(uploadOptions = {}) {
return function(url, filePath, options) {
return function(url, filePath, options = {}) {
const _option = deepMerge(

@@ -276,0 +276,0 @@ { url, filePath },

{
"name": "mp-network",
"version": "0.1.0",
"version": "0.1.1",
"description": "小程序 网络请求接口二次封装, request/upload/download,适配多个平台",

@@ -5,0 +5,0 @@ "keywords": [

@@ -111,2 +111,18 @@ # mp-network

**示例6: 请求拦截器**
```js
// 请求体拦截器
request.interceptor.request.use((config) => {
// do something
// 必须返回 config
return config
})
request.interceptor.response.use((config) => {
// do something
// 返回处理后的数据
return config.data
})
```
## Methods

@@ -155,2 +171,9 @@

#### 拦截器
- `request.interceptor` 拦截器
- `request.interceptor.request.use(fulfilled, rejected)` 请求体拦截器
- `request.interceptor.response.use(fulfilled, rejected)` 响应体拦截器
### upload

@@ -157,0 +180,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