@xterm/addon-image 0.10.0-beta.137 → 0.10.0-beta.138
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/lib/addon-image.js +1 -1
- package/lib/addon-image.js.map +1 -1
- package/lib/addon-image.mjs +7 -7
- package/lib/addon-image.mjs.map +2 -2
- package/package.json +3 -3
- package/src/IIPHandler.ts +0 -4
- package/src/IIPHeaderParser.ts +3 -2
- package/src/ImageStorage.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-image",
|
|
3
|
-
"version": "0.10.0-beta.
|
|
3
|
+
"version": "0.10.0-beta.138",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"sixel": "^0.16.0",
|
|
28
28
|
"xterm-wasm-parts": "^0.1.0"
|
|
29
29
|
},
|
|
30
|
-
"commit": "
|
|
30
|
+
"commit": "dbe35428cb71aff3214dc0068cf695861ec77116",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
32
|
+
"@xterm/xterm": "^6.1.0-beta.138"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/IIPHandler.ts
CHANGED
|
@@ -9,10 +9,6 @@ import Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';
|
|
|
9
9
|
import { HeaderParser, IHeaderFields, HeaderState } from './IIPHeaderParser';
|
|
10
10
|
import { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line
|
|
14
|
-
declare const Buffer: any;
|
|
15
|
-
|
|
16
12
|
// limit hold memory in base64 decoder
|
|
17
13
|
const KEEP_DATA = 4194304;
|
|
18
14
|
|
package/src/IIPHeaderParser.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const Buffer: any;
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export interface IHeaderFields {
|
|
11
|
+
[key: string]: number | string | Uint32Array | null | undefined;
|
|
11
12
|
// base-64 encoded filename. Defaults to "Unnamed file".
|
|
12
13
|
name: string;
|
|
13
14
|
// File size in bytes. The file transfer will be canceled if this size is exceeded.
|
|
@@ -81,7 +82,7 @@ function toName(data: Uint32Array): string {
|
|
|
81
82
|
return new TextDecoder().decode(b);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
const DECODERS: {[key: string]: (v: Uint32Array) =>
|
|
85
|
+
const DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {
|
|
85
86
|
inline: toInt,
|
|
86
87
|
size: toInt,
|
|
87
88
|
name: toName,
|
|
@@ -100,7 +101,7 @@ export class HeaderParser {
|
|
|
100
101
|
private _buffer = new Uint32Array(MAX_FIELDCHARS);
|
|
101
102
|
private _position = 0;
|
|
102
103
|
private _key = '';
|
|
103
|
-
public fields: {[key: string]:
|
|
104
|
+
public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};
|
|
104
105
|
|
|
105
106
|
public reset(): void {
|
|
106
107
|
this._buffer.fill(0);
|
package/src/ImageStorage.ts
CHANGED
|
@@ -132,8 +132,10 @@ export class ImageStorage implements IDisposable {
|
|
|
132
132
|
) {
|
|
133
133
|
try {
|
|
134
134
|
this.setLimit(this._opts.storageLimit);
|
|
135
|
-
} catch (e:
|
|
136
|
-
|
|
135
|
+
} catch (e: unknown) {
|
|
136
|
+
if (e instanceof Error) {
|
|
137
|
+
console.error(e.message);
|
|
138
|
+
}
|
|
137
139
|
console.warn(`storageLimit is set to ${this.getLimit()} MB`);
|
|
138
140
|
}
|
|
139
141
|
this._viewportMetrics = {
|