beer-network 1.2.10 → 1.3.2
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.
- package/api.d.ts +6 -0
- package/api.js +14 -3
- package/{elementUtils.js → element-utils.js} +2 -1
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/package.json +1 -1
- package/session.d.ts +1 -1
- package/session.js +1 -1
- /package/{elementUtils.d.ts → element-utils.d.ts} +0 -0
- /package/{NextHeadersLazy.d.ts → next-headers.d.ts} +0 -0
- /package/{NextHeadersLazy.js → next-headers.js} +0 -0
package/api.d.ts
CHANGED
|
@@ -36,7 +36,13 @@ export default class Fetch {
|
|
|
36
36
|
* 请求地址.
|
|
37
37
|
*/
|
|
38
38
|
private readonly pathPrefix;
|
|
39
|
+
/**
|
|
40
|
+
* 是否是NodeJS 环境.
|
|
41
|
+
*/
|
|
39
42
|
private readonly isNode;
|
|
43
|
+
/**
|
|
44
|
+
* 是否支持 NextJs 框架.
|
|
45
|
+
*/
|
|
40
46
|
private isNextJS;
|
|
41
47
|
constructor(pathPrefix?: string);
|
|
42
48
|
private sendBody;
|
package/api.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getNodeHeaders } from './
|
|
1
|
+
import Session from './session';
|
|
2
|
+
import { getNodeHeaders } from './next-headers';
|
|
3
3
|
export default class Fetch {
|
|
4
|
+
/**
|
|
5
|
+
* 请求地址.
|
|
6
|
+
*/
|
|
7
|
+
pathPrefix;
|
|
8
|
+
/**
|
|
9
|
+
* 是否是NodeJS 环境.
|
|
10
|
+
*/
|
|
11
|
+
isNode;
|
|
12
|
+
/**
|
|
13
|
+
* 是否支持 NextJs 框架.
|
|
14
|
+
*/
|
|
15
|
+
isNextJS = undefined;
|
|
4
16
|
constructor(pathPrefix) {
|
|
5
|
-
this.isNextJS = undefined;
|
|
6
17
|
this.pathPrefix = pathPrefix || '';
|
|
7
18
|
this.isNode = typeof process !== 'undefined' && !!process.versions?.node;
|
|
8
19
|
}
|
|
@@ -22,10 +22,11 @@ export default class ElementUtils {
|
|
|
22
22
|
*/
|
|
23
23
|
static async selectDirectory() {
|
|
24
24
|
if (!window.showDirectoryPicker) {
|
|
25
|
+
// eslint-disable-next-line no-alert
|
|
25
26
|
alert('您的浏览器不支持文件夹选择功能');
|
|
26
27
|
return undefined;
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return window.showDirectoryPicker();
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* 下载文件.
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beer-network",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
|
|
7
7
|
"pub-m": "tsc && cp package.json ./dist/package.json && npm publish ./dist"
|
package/session.d.ts
CHANGED
package/session.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|