xshell 1.0.101 → 1.0.102
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/package.json +1 -1
- package/server.js +9 -4
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +2 -2
- package/utils.js +1 -1
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -469,10 +469,15 @@ export class Server {
|
|
|
469
469
|
redirect,
|
|
470
470
|
timeout
|
|
471
471
|
});
|
|
472
|
-
response.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
472
|
+
if (response.writable) {
|
|
473
|
+
response.status = response_.status;
|
|
474
|
+
response.set(Server.filter_response_headers(response_.headers));
|
|
475
|
+
if (response_.body)
|
|
476
|
+
response.body = response_.body;
|
|
477
|
+
}
|
|
478
|
+
else
|
|
479
|
+
// todo: 临时观察
|
|
480
|
+
console.log(`${path_url} 对应的 response.writable === false`);
|
|
476
481
|
}
|
|
477
482
|
catch (error) {
|
|
478
483
|
if (error.response?.status !== 404)
|
package/utils.browser.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare function encode(str: string): Uint8Array;
|
|
|
63
63
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
64
64
|
export declare function decode(buffer: Uint8Array): string;
|
|
65
65
|
/** 字符串字典序比较 */
|
|
66
|
-
export declare function strcmp(l: string, r: string):
|
|
66
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
67
67
|
/** 比较 1.10.02 这种版本号 */
|
|
68
68
|
export declare function vercmp(l: string, r: string): number;
|
|
69
69
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.d.ts
CHANGED
|
@@ -34,12 +34,12 @@ export declare function map_values<TValue, TNewValue>(obj: {
|
|
|
34
34
|
};
|
|
35
35
|
/** 过滤对象中的 keys, 返回新对象 */
|
|
36
36
|
export declare function filter_keys<TObj>(obj: TObj, filter: (key: string) => any): TObj;
|
|
37
|
-
/** 过滤对象中的
|
|
37
|
+
/** 过滤对象中的 valus, 返回新对象 */
|
|
38
38
|
export declare function filter_values<TObj extends Record<string, any>>(obj: TObj, filter?: (value: TObj[string]) => any): TObj;
|
|
39
39
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
40
40
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
|
|
41
41
|
/** 字符串字典序比较 */
|
|
42
|
-
export declare function strcmp(l: string, r: string):
|
|
42
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
43
43
|
/** 比较 1.10.02 这种版本号 */
|
|
44
44
|
export declare function vercmp(l: string, r: string): number;
|
|
45
45
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.js
CHANGED
|
@@ -80,7 +80,7 @@ export function filter_keys(obj, filter) {
|
|
|
80
80
|
return Object.fromEntries(Object.entries(obj)
|
|
81
81
|
.filter(([key]) => filter(key)));
|
|
82
82
|
}
|
|
83
|
-
/** 过滤对象中的
|
|
83
|
+
/** 过滤对象中的 valus, 返回新对象 */
|
|
84
84
|
export function filter_values(obj, filter = not_empty) {
|
|
85
85
|
return Object.fromEntries(Object.entries(obj)
|
|
86
86
|
.filter(([, value]) => filter(value)));
|