@fetchx/fetcher-jsonp 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/types/index.ts"],"sourcesContent":["/**\n * 纯 JSONP options\n */\nexport interface IJsonpOptions {\n /**\n * 与服务端的参数名协议,告诉服务端,当你接收到参数名为此配置值的时候,需要返回 JSONP 格式,默认为 jsonp\n */\n jsonpCallback?: string;\n /**\n * 通常 jsonpCallback 配置值对应的方法是自动创建的,它会放在 window 下,如果你需要自己指定方法,可以用它,\n * 但必须自己保证可以通过 `window[此配置值]` 访问到它\n */\n jsonpCallbackFunction?: string;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/types/index.ts"],"sourcesContent":["/**\n * 纯 JSONP options\n */\nexport interface IJsonpOptions {\n charset?: string;\n /**\n * 与服务端的参数名协议,告诉服务端,当你接收到参数名为此配置值的时候,需要返回 JSONP 格式,默认为 jsonp\n */\n jsonpCallback?: string;\n /**\n * 通常 jsonpCallback 配置值对应的方法是自动创建的,它会放在 window 下,如果你需要自己指定方法,可以用它,\n * 但必须自己保证可以通过 `window[此配置值]` 访问到它\n */\n jsonpCallbackFunction?: string;\n timeout?: number;\n /**\n * 让 JSONP 得以 abort,和 fetch 类型一致\n */\n signal?: AbortSignal | null;\n}\n\n/**\n * 模仿 Response 对象,fetch 的 Response 对象还包含以下额外属性\n *\n * - body: ReadableStream;\n * - bodyUsed: boolean;\n * - redirected: boolean;\n * - statusText: string;\n * - type: string; // basic\n */\nexport interface IJsonpResponse<T = unknown> {\n ok: true; // 跟 status 有关,对应 status 在 200-299 范围内,所以 status 和 statusText 就直接忽略了\n status: 200; // Jsonp 只能 200\n headers: null; // JSONP 无法有 headers\n url: string;\n json(): Promise<T>;\n text(): Promise<string>;\n blob(): Promise<null>;\n arrayBuffer(): Promise<null>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* 纯 JSONP options
|
|
3
3
|
*/
|
|
4
4
|
export interface IJsonpOptions {
|
|
5
|
+
charset?: string;
|
|
5
6
|
/**
|
|
6
7
|
* 与服务端的参数名协议,告诉服务端,当你接收到参数名为此配置值的时候,需要返回 JSONP 格式,默认为 jsonp
|
|
7
8
|
*/
|
|
@@ -11,7 +12,6 @@ export interface IJsonpOptions {
|
|
|
11
12
|
* 但必须自己保证可以通过 `window[此配置值]` 访问到它
|
|
12
13
|
*/
|
|
13
14
|
jsonpCallbackFunction?: string;
|
|
14
|
-
charset?: string;
|
|
15
15
|
timeout?: number;
|
|
16
16
|
/**
|
|
17
17
|
* 让 JSONP 得以 abort,和 fetch 类型一致
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fetchx/fetcher-jsonp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "The jsonp implementation, can be used alone.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"@chromatic-com/storybook": "^5.6.0",
|
|
31
31
|
"@kcuf/demo-rc": "^0.7.3",
|
|
32
32
|
"@kcuf/ts-config": "^0.2.0",
|
|
33
|
-
"@storybook/addon-docs": "^10.6.
|
|
34
|
-
"@storybook/addon-links": "^10.6.
|
|
35
|
-
"@storybook/react-vite": "^10.6.
|
|
33
|
+
"@storybook/addon-docs": "^10.6.8",
|
|
34
|
+
"@storybook/addon-links": "^10.6.8",
|
|
35
|
+
"@storybook/react-vite": "^10.6.8",
|
|
36
36
|
"@types/jsdom": "^30.0.0",
|
|
37
|
-
"@types/react": "^19.3.
|
|
37
|
+
"@types/react": "^19.3.1",
|
|
38
38
|
"@vitest/coverage-v8": "^5.1.1",
|
|
39
39
|
"jsdom": "^31.0.1",
|
|
40
40
|
"react": "^19.3.1",
|
|
41
41
|
"rimraf": "^6.1.4",
|
|
42
|
-
"storybook": "^10.6.
|
|
43
|
-
"styled-components": "^6.
|
|
42
|
+
"storybook": "^10.6.8",
|
|
43
|
+
"styled-components": "^6.7.0",
|
|
44
44
|
"typescript": "^6.0.3",
|
|
45
45
|
"vitest": "^5.1.1"
|
|
46
46
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@babel/runtime": ">=7.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@fetchx/fetcher-helper": "^0.1.
|
|
51
|
+
"@fetchx/fetcher-helper": "^0.1.5"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"start": "storybook dev -p 6006",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"test": "vitest --coverage --coverage.include=src",
|
|
63
63
|
"prepublishOnly": "pnpm build:clean && pnpm build"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "db1d93479dac474769f0b4ccec5dded50d62f847"
|
|
66
66
|
}
|