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

zan-ajax

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zan-ajax - npm Package Compare versions

Comparing version 1.1.4-beta2 to 1.1.4

2

package.json
{
"name": "zan-ajax",
"version": "1.1.4-beta2",
"version": "1.1.4",
"description": "Promise based HTTP client for the browser and node",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -59,3 +59,3 @@ ## ajax

* **`method` / `type`**: <`string`> 请求的类型,默认`GET`请求
* **`data`**: <`object`> HTTP请求的参数,`GET` / `HEAD`类请求会作为URL参数,`POST` / `PUT`等请求会作为`body`
* **`data`**: <`any`> HTTP请求的参数,`GET` / `HEAD`类请求会作为URL参数,`POST` / `PUT`等请求会作为`body`
* **`contentType`**: <`string`> 发送给服务器的数据类型,`POST` / `PUT`等请求默认值为* `'application/x-www-form-urlencoded; charset=UTF-8'`

@@ -62,0 +62,0 @@ * **`dataType`**: <`string`> 请求的返回值类型,默认`json`,可选项`arraybuffer`, `blob`, `document`, `json`, * `text`, `stream`

import { CancelToken } from 'axios';
export type RequestParams = { [key: string]: any } | any[];
export interface IJsonpOptions {
dataType: 'jsonp' | 'JSONP';
url: string;
data?: RequestParams;
data?: any;
jsonp?: string;

@@ -18,6 +16,5 @@ jsonpCallback?: string | (() => string);

url: string;
data?: RequestParams;
data?: any;
method?: string;
contentType?: string;
dataType:
dataType?:
| 'json'

@@ -35,2 +32,3 @@ | 'arraybuffer'

| 'ARRAYBUFFER';
contentType?: string;
headers?: { [key: string]: string };

@@ -48,3 +46,3 @@ withCredentials?: boolean;

export type RequestOptions = IJsonpOptions | IAjaxOptions;
export type RequestOptions = IAjaxOptions | IJsonpOptions;

@@ -55,7 +53,7 @@ export interface IRequestConfig {

declare function ajax(
declare function ajax<T = any>(
options: RequestOptions,
config?: IRequestConfig
): Promise;
): Promise<T>;
export default ajax;
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