Update webpack, components for eslint. Adjust effected settings and code.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
parser: "babel-eslint",
|
parser: "@babel/eslint-parser",
|
||||||
},
|
},
|
||||||
root: true,
|
root: true,
|
||||||
env: {
|
env: {
|
||||||
@@ -14,8 +14,9 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
|
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
|
||||||
|
"no-unused-vars": process.env.NODE_ENV === "production" ? "warn" : "error",
|
||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
$nuxt: true,
|
$nuxt: true,
|
||||||
|
|||||||
730
package-lock.json
generated
730
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,11 @@
|
|||||||
"main": "",
|
"main": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.14.6",
|
"@babel/core": "^7.14.6",
|
||||||
|
"@babel/eslint-parser": "^7.14.7",
|
||||||
"@babel/plugin-transform-runtime": "^7.14.5",
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
||||||
"@babel/preset-env": "^7.14.7",
|
"@babel/preset-env": "^7.14.7",
|
||||||
"@babel/register": "^7.14.5",
|
"@babel/register": "^7.14.5",
|
||||||
"@babel/runtime": "^7.14.6",
|
"@babel/runtime": "^7.14.6",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
"css-minimizer-webpack-plugin": "^3.0.2",
|
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||||
"eslint": "^7.30.0",
|
"eslint": "^7.30.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-loader": "^4.0.2",
|
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"eslint-plugin-vue": "^7.13.0",
|
"eslint-plugin-vue": "^7.13.0",
|
||||||
|
"eslint-webpack-plugin": "^2.5.4",
|
||||||
"favicons": "^6.2.2",
|
"favicons": "^6.2.2",
|
||||||
"favicons-webpack-plugin": "^5.0.2",
|
"favicons-webpack-plugin": "^5.0.2",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"vue": "^2.6.14",
|
"vue": "^2.6.14",
|
||||||
"vue-loader": "^15.9.7",
|
"vue-loader": "^15.9.7",
|
||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.6.14",
|
||||||
"webpack": "^5.43.0",
|
"webpack": "^5.44.0",
|
||||||
"webpack-cli": "^4.7.2",
|
"webpack-cli": "^4.7.2",
|
||||||
"xterm": "^4.13.0",
|
"xterm": "^4.13.0",
|
||||||
"xterm-addon-fit": "^0.5.0",
|
"xterm-addon-fit": "^0.5.0",
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ export class Address {
|
|||||||
throw new Exception("Host name cannot longer than " + MAX_ADDR_LEN);
|
throw new Exception("Host name cannot longer than " + MAX_ADDR_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
let dataBuf = new Uint8Array(this.addrData.length + 3);
|
let dataBuf = new Uint8Array(this.addrData.length + 3);
|
||||||
|
|
||||||
dataBuf[0] = (this.addrPort >> 8) & 0xff;
|
dataBuf[0] = (this.addrPort >> 8) & 0xff;
|
||||||
@@ -183,6 +184,7 @@ export class Address {
|
|||||||
dataBuf.set(this.addrData, 3);
|
dataBuf.set(this.addrData, 3);
|
||||||
|
|
||||||
return dataBuf;
|
return dataBuf;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unknown address type");
|
throw new Exception("Unknown address type");
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ describe("Address", () => {
|
|||||||
|
|
||||||
let addr2 = await address.Address.read(r);
|
let addr2 = await address.Address.read(r);
|
||||||
|
|
||||||
assert.equal(addr2.type(), addr.type());
|
assert.strictEqual(addr2.type(), addr.type());
|
||||||
assert.deepEqual(addr2.address(), addr.address());
|
assert.deepStrictEqual(addr2.address(), addr.address());
|
||||||
assert.equal(addr2.port(), addr.port());
|
assert.strictEqual(addr2.port(), addr.port());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Address IPv4", async () => {
|
it("Address IPv4", async () => {
|
||||||
@@ -53,9 +53,9 @@ describe("Address", () => {
|
|||||||
|
|
||||||
let addr2 = await address.Address.read(r);
|
let addr2 = await address.Address.read(r);
|
||||||
|
|
||||||
assert.equal(addr2.type(), addr.type());
|
assert.strictEqual(addr2.type(), addr.type());
|
||||||
assert.deepEqual(addr2.address(), addr.address());
|
assert.deepStrictEqual(addr2.address(), addr.address());
|
||||||
assert.equal(addr2.port(), addr.port());
|
assert.strictEqual(addr2.port(), addr.port());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Address IPv6", async () => {
|
it("Address IPv6", async () => {
|
||||||
@@ -74,9 +74,9 @@ describe("Address", () => {
|
|||||||
|
|
||||||
let addr2 = await address.Address.read(r);
|
let addr2 = await address.Address.read(r);
|
||||||
|
|
||||||
assert.equal(addr2.type(), addr.type());
|
assert.strictEqual(addr2.type(), addr.type());
|
||||||
assert.deepEqual(addr2.address(), addr.address());
|
assert.deepStrictEqual(addr2.address(), addr.address());
|
||||||
assert.equal(addr2.port(), addr.port());
|
assert.strictEqual(addr2.port(), addr.port());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Address HostName", async () => {
|
it("Address HostName", async () => {
|
||||||
@@ -95,8 +95,8 @@ describe("Address", () => {
|
|||||||
|
|
||||||
let addr2 = await address.Address.read(r);
|
let addr2 = await address.Address.read(r);
|
||||||
|
|
||||||
assert.equal(addr2.type(), addr.type());
|
assert.strictEqual(addr2.type(), addr.type());
|
||||||
assert.deepEqual(addr2.address(), addr.address());
|
assert.deepStrictEqual(addr2.address(), addr.address());
|
||||||
assert.equal(addr2.port(), addr.port());
|
assert.strictEqual(addr2.port(), addr.port());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,11 +63,11 @@ describe("Common", () => {
|
|||||||
ee = e;
|
ee = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.notEqual(ee, null, "Test " + tests[i].sample);
|
assert.notStrictEqual(ee, null, "Test " + tests[i].sample);
|
||||||
} else {
|
} else {
|
||||||
let data = common.parseIPv4(tests[i].sample);
|
let data = common.parseIPv4(tests[i].sample);
|
||||||
|
|
||||||
assert.deepEqual(data, tests[i].expected);
|
assert.deepStrictEqual(data, tests[i].expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -78,28 +78,14 @@ describe("Common", () => {
|
|||||||
sample: "2001:db8:1f70:0:999:de8:7648:6e8",
|
sample: "2001:db8:1f70:0:999:de8:7648:6e8",
|
||||||
expectingFailure: false,
|
expectingFailure: false,
|
||||||
expected: new Uint16Array([
|
expected: new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
|
||||||
0xdb8,
|
|
||||||
0x1f70,
|
|
||||||
0x0,
|
|
||||||
0x999,
|
|
||||||
0xde8,
|
|
||||||
0x7648,
|
|
||||||
0x6e8,
|
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sample: "2001:db8:85a3::8a2e:370:7334",
|
sample: "2001:db8:85a3::8a2e:370:7334",
|
||||||
expectingFailure: false,
|
expectingFailure: false,
|
||||||
expected: new Uint16Array([
|
expected: new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0xdb8, 0x85a3, 0x0, 0x0, 0x8a2e, 0x370, 0x7334,
|
||||||
0xdb8,
|
|
||||||
0x85a3,
|
|
||||||
0x0,
|
|
||||||
0x0,
|
|
||||||
0x8a2e,
|
|
||||||
0x370,
|
|
||||||
0x7334,
|
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -116,42 +102,21 @@ describe("Common", () => {
|
|||||||
sample: "2001:db8:1f70::999:de8:7648:6e8",
|
sample: "2001:db8:1f70::999:de8:7648:6e8",
|
||||||
expectingFailure: false,
|
expectingFailure: false,
|
||||||
expected: new Uint16Array([
|
expected: new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
|
||||||
0xdb8,
|
|
||||||
0x1f70,
|
|
||||||
0x0,
|
|
||||||
0x999,
|
|
||||||
0xde8,
|
|
||||||
0x7648,
|
|
||||||
0x6e8,
|
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sample: "2001:0db8:ac10:fe01::",
|
sample: "2001:0db8:ac10:fe01::",
|
||||||
expectingFailure: false,
|
expectingFailure: false,
|
||||||
expected: new Uint16Array([
|
expected: new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0x0db8, 0xac10, 0xfe01, 0x0, 0x0, 0x0, 0x0,
|
||||||
0x0db8,
|
|
||||||
0xac10,
|
|
||||||
0xfe01,
|
|
||||||
0x0,
|
|
||||||
0x0,
|
|
||||||
0x0,
|
|
||||||
0x0,
|
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sample: "::7f00:1",
|
sample: "::7f00:1",
|
||||||
expectingFailure: false,
|
expectingFailure: false,
|
||||||
expected: new Uint16Array([
|
expected: new Uint16Array([
|
||||||
0x0000,
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7f00, 0x0001,
|
||||||
0x0000,
|
|
||||||
0x0000,
|
|
||||||
0x0000,
|
|
||||||
0x0000,
|
|
||||||
0x0000,
|
|
||||||
0x7f00,
|
|
||||||
0x0001,
|
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -191,11 +156,11 @@ describe("Common", () => {
|
|||||||
ee = e;
|
ee = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.notEqual(ee, null, "Test " + tests[i].sample);
|
assert.notStrictEqual(ee, null, "Test " + tests[i].sample);
|
||||||
} else {
|
} else {
|
||||||
let data = common.parseIPv6(tests[i].sample);
|
let data = common.parseIPv6(tests[i].sample);
|
||||||
|
|
||||||
assert.deepEqual(data, tests[i].expected);
|
assert.deepStrictEqual(data, tests[i].expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -236,14 +201,7 @@ describe("Common", () => {
|
|||||||
expectedType: "IPv6",
|
expectedType: "IPv6",
|
||||||
expectedAddr: new Uint8Array(
|
expectedAddr: new Uint8Array(
|
||||||
new Uint16Array([
|
new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
|
||||||
0xdb8,
|
|
||||||
0x1f70,
|
|
||||||
0x0,
|
|
||||||
0x999,
|
|
||||||
0xde8,
|
|
||||||
0x7648,
|
|
||||||
0x6e8,
|
|
||||||
]).buffer
|
]).buffer
|
||||||
),
|
),
|
||||||
expectedPort: 22,
|
expectedPort: 22,
|
||||||
@@ -253,14 +211,7 @@ describe("Common", () => {
|
|||||||
expectedType: "IPv6",
|
expectedType: "IPv6",
|
||||||
expectedAddr: new Uint8Array(
|
expectedAddr: new Uint8Array(
|
||||||
new Uint16Array([
|
new Uint16Array([
|
||||||
0x2001,
|
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
|
||||||
0xdb8,
|
|
||||||
0x1f70,
|
|
||||||
0x0,
|
|
||||||
0x999,
|
|
||||||
0xde8,
|
|
||||||
0x7648,
|
|
||||||
0x6e8,
|
|
||||||
]).buffer
|
]).buffer
|
||||||
),
|
),
|
||||||
expectedPort: 100,
|
expectedPort: 100,
|
||||||
@@ -270,9 +221,9 @@ describe("Common", () => {
|
|||||||
for (let i in tests) {
|
for (let i in tests) {
|
||||||
let hostport = common.splitHostPort(tests[i].sample, 22);
|
let hostport = common.splitHostPort(tests[i].sample, 22);
|
||||||
|
|
||||||
assert.deepEqual(hostport.type, tests[i].expectedType);
|
assert.deepStrictEqual(hostport.type, tests[i].expectedType);
|
||||||
assert.deepEqual(hostport.addr, tests[i].expectedAddr);
|
assert.deepStrictEqual(hostport.addr, tests[i].expectedAddr);
|
||||||
assert.equal(hostport.port, tests[i].expectedPort);
|
assert.strictEqual(hostport.port, tests[i].expectedPort);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe("Integer", () => {
|
|||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.equal(marshalled.length, 1);
|
assert.strictEqual(marshalled.length, 1);
|
||||||
|
|
||||||
r.feed(marshalled);
|
r.feed(marshalled);
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ describe("Integer", () => {
|
|||||||
|
|
||||||
await i2.unmarshal(r);
|
await i2.unmarshal(r);
|
||||||
|
|
||||||
assert.equal(i.value(), i2.value());
|
assert.strictEqual(i.value(), i2.value());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Integer MAX", async () => {
|
it("Integer MAX", async () => {
|
||||||
@@ -47,7 +47,7 @@ describe("Integer", () => {
|
|||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.equal(marshalled.length, 2);
|
assert.strictEqual(marshalled.length, 2);
|
||||||
|
|
||||||
r.feed(marshalled);
|
r.feed(marshalled);
|
||||||
|
|
||||||
@@ -55,6 +55,6 @@ describe("Integer", () => {
|
|||||||
|
|
||||||
await i2.unmarshal(r);
|
await i2.unmarshal(r);
|
||||||
|
|
||||||
assert.equal(i.value(), i2.value());
|
assert.strictEqual(i.value(), i2.value());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ describe("String", () => {
|
|||||||
|
|
||||||
let s2 = await strings.String.read(r);
|
let s2 = await strings.String.read(r);
|
||||||
|
|
||||||
assert.deepEqual(s2.data(), s.data());
|
assert.deepStrictEqual(s2.data(), s.data());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("String 2", async () => {
|
it("String 2", async () => {
|
||||||
@@ -260,6 +260,6 @@ describe("String", () => {
|
|||||||
|
|
||||||
let s2 = await strings.String.read(r);
|
let s2 = await strings.String.read(r);
|
||||||
|
|
||||||
assert.deepEqual(s2.data(), s.data());
|
assert.deepStrictEqual(s2.data(), s.data());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ class Parser {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
let dim = this.callbacks.getWindowDim(),
|
let dim = this.callbacks.getWindowDim(),
|
||||||
dimData = new DataView(new ArrayBuffer(4));
|
dimData = new DataView(new ArrayBuffer(4));
|
||||||
|
|
||||||
@@ -275,6 +276,7 @@ class Parser {
|
|||||||
|
|
||||||
this.options.nawsAccpeted = true;
|
this.options.nawsAccpeted = true;
|
||||||
this.sendWillSubNego(cmdWill, dimBytes, optNAWS);
|
this.sendWillSubNego(cmdWill, dimBytes, optNAWS);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case optTerminalType:
|
case optTerminalType:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function build(ctx) {
|
|||||||
inbound: 0,
|
inbound: 0,
|
||||||
inboundHistory: inboundHistory.get(),
|
inboundHistory: inboundHistory.get(),
|
||||||
outbound: 0,
|
outbound: 0,
|
||||||
outboundHistory: outboundHistory.get()
|
outboundHistory: outboundHistory.get(),
|
||||||
},
|
},
|
||||||
connecting() {
|
connecting() {
|
||||||
isClosed = false;
|
isClosed = false;
|
||||||
@@ -201,6 +201,6 @@ export function build(ctx) {
|
|||||||
this.classStyle = "red flash";
|
this.classStyle = "red flash";
|
||||||
this.windowClass = "red";
|
this.windowClass = "red";
|
||||||
this.status.description = connectionStatusDisconnected + ". Error: " + e;
|
this.status.description = connectionStatusDisconnected + ". Error: " + e;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,116 +22,11 @@ describe("Common", () => {
|
|||||||
it("separateBuffer", async () => {
|
it("separateBuffer", async () => {
|
||||||
let resultArr = [];
|
let resultArr = [];
|
||||||
const expected = new Uint8Array([
|
const expected = new Uint8Array([
|
||||||
0,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
|
||||||
1,
|
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
2,
|
8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
|
||||||
3,
|
2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
|
||||||
4,
|
6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
]),
|
]),
|
||||||
sepSeg = common.separateBuffer(expected, 16);
|
sepSeg = common.separateBuffer(expected, 16);
|
||||||
|
|
||||||
@@ -141,6 +36,6 @@ describe("Common", () => {
|
|||||||
|
|
||||||
const result = new Uint8Array(resultArr);
|
const result = new Uint8Array(resultArr);
|
||||||
|
|
||||||
assert.deepEqual(result, expected);
|
assert.deepStrictEqual(result, expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ describe("Header", () => {
|
|||||||
|
|
||||||
let n = new header.Header(h.value());
|
let n = new header.Header(h.value());
|
||||||
|
|
||||||
assert.equal(h.type(), n.type());
|
assert.strictEqual(h.type(), n.type());
|
||||||
assert.equal(h.data(), n.data());
|
assert.strictEqual(h.data(), n.data());
|
||||||
assert.equal(n.type(), header.CONTROL);
|
assert.strictEqual(n.type(), header.CONTROL);
|
||||||
assert.equal(n.data(), 63);
|
assert.strictEqual(n.data(), 63);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Stream", () => {
|
it("Stream", () => {
|
||||||
@@ -37,11 +37,11 @@ describe("Header", () => {
|
|||||||
|
|
||||||
h.set(header.STREAM_MAX_MARKER, header.STREAM_MAX_LENGTH);
|
h.set(header.STREAM_MAX_MARKER, header.STREAM_MAX_LENGTH);
|
||||||
|
|
||||||
assert.equal(h.marker(), header.STREAM_MAX_MARKER);
|
assert.strictEqual(h.marker(), header.STREAM_MAX_MARKER);
|
||||||
assert.equal(h.length(), header.STREAM_MAX_LENGTH);
|
assert.strictEqual(h.length(), header.STREAM_MAX_LENGTH);
|
||||||
|
|
||||||
assert.equal(h.headerByte1, 0xff);
|
assert.strictEqual(h.headerByte1, 0xff);
|
||||||
assert.equal(h.headerByte2, 0xff);
|
assert.strictEqual(h.headerByte2, 0xff);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("InitialStream", () => {
|
it("InitialStream", () => {
|
||||||
@@ -49,8 +49,8 @@ describe("Header", () => {
|
|||||||
|
|
||||||
h.set(15, 128, true);
|
h.set(15, 128, true);
|
||||||
|
|
||||||
assert.equal(h.command(), 15);
|
assert.strictEqual(h.command(), 15);
|
||||||
assert.equal(h.data(), 128);
|
assert.strictEqual(h.data(), 128);
|
||||||
assert.equal(h.success(), true);
|
assert.strictEqual(h.success(), true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ describe("Reader", () => {
|
|||||||
|
|
||||||
let ex = buf.export(1);
|
let ex = buf.export(1);
|
||||||
|
|
||||||
assert.equal(ex.length, 1);
|
assert.strictEqual(ex.length, 1);
|
||||||
assert.equal(ex[0], 0);
|
assert.strictEqual(ex[0], 0);
|
||||||
assert.equal(buf.remains(), 7);
|
assert.strictEqual(buf.remains(), 7);
|
||||||
|
|
||||||
ex = await reader.readCompletely(buf);
|
ex = await reader.readCompletely(buf);
|
||||||
|
|
||||||
assert.equal(ex.length, 7);
|
assert.strictEqual(ex.length, 7);
|
||||||
assert.deepEqual(ex, new Uint8Array([1, 2, 3, 4, 5, 6, 7]));
|
assert.deepStrictEqual(ex, new Uint8Array([1, 2, 3, 4, 5, 6, 7]));
|
||||||
assert.equal(buf.remains(), 0);
|
assert.strictEqual(buf.remains(), 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Reader", async () => {
|
it("Reader", async () => {
|
||||||
@@ -45,30 +45,7 @@ describe("Reader", () => {
|
|||||||
return data;
|
return data;
|
||||||
}),
|
}),
|
||||||
expected = [
|
expected = [
|
||||||
0,
|
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
],
|
],
|
||||||
feedIntv = setInterval(() => {
|
feedIntv = setInterval(() => {
|
||||||
r.feed(Uint8Array.from(expected.slice(0, 8)));
|
r.feed(Uint8Array.from(expected.slice(0, 8)));
|
||||||
@@ -88,7 +65,7 @@ describe("Reader", () => {
|
|||||||
result.push((await r.export(1))[0]);
|
result.push((await r.export(1))[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.deepEqual(result, expected);
|
assert.deepStrictEqual(result, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("readOne", async () => {
|
it("readOne", async () => {
|
||||||
@@ -102,11 +79,11 @@ describe("Reader", () => {
|
|||||||
|
|
||||||
let rr = await reader.readOne(r);
|
let rr = await reader.readOne(r);
|
||||||
|
|
||||||
assert.deepEqual(rr, Uint8Array.from([0]));
|
assert.deepStrictEqual(rr, Uint8Array.from([0]));
|
||||||
|
|
||||||
rr = await reader.readOne(r);
|
rr = await reader.readOne(r);
|
||||||
|
|
||||||
assert.deepEqual(rr, Uint8Array.from([1]));
|
assert.deepStrictEqual(rr, Uint8Array.from([1]));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("readN", async () => {
|
it("readN", async () => {
|
||||||
@@ -120,11 +97,11 @@ describe("Reader", () => {
|
|||||||
|
|
||||||
let rr = await reader.readN(r, 3);
|
let rr = await reader.readN(r, 3);
|
||||||
|
|
||||||
assert.deepEqual(rr, Uint8Array.from([0, 1, 2]));
|
assert.deepStrictEqual(rr, Uint8Array.from([0, 1, 2]));
|
||||||
|
|
||||||
rr = await reader.readN(r, 3);
|
rr = await reader.readN(r, 3);
|
||||||
|
|
||||||
assert.deepEqual(rr, Uint8Array.from([3, 4, 5]));
|
assert.deepStrictEqual(rr, Uint8Array.from([3, 4, 5]));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Limited", async () => {
|
it("Limited", async () => {
|
||||||
@@ -153,8 +130,8 @@ describe("Reader", () => {
|
|||||||
result.push((await limited.export(1))[0]);
|
result.push((await limited.export(1))[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.equal(limited.completed(), true);
|
assert.strictEqual(limited.completed(), true);
|
||||||
assert.deepEqual(result, expected);
|
assert.deepStrictEqual(result, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("readCompletely", async () => {
|
it("readCompletely", async () => {
|
||||||
@@ -179,8 +156,8 @@ describe("Reader", () => {
|
|||||||
|
|
||||||
let result = await reader.readCompletely(limited);
|
let result = await reader.readCompletely(limited);
|
||||||
|
|
||||||
assert.equal(limited.completed(), true);
|
assert.strictEqual(limited.completed(), true);
|
||||||
assert.deepEqual(result, Uint8Array.from(expected));
|
assert.deepStrictEqual(result, Uint8Array.from(expected));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("readUntil", async () => {
|
it("readUntil", async () => {
|
||||||
@@ -207,14 +184,14 @@ describe("Reader", () => {
|
|||||||
|
|
||||||
let result = await reader.readUntil(limited, 7);
|
let result = await reader.readUntil(limited, 7);
|
||||||
|
|
||||||
assert.equal(limited.completed(), false);
|
assert.strictEqual(limited.completed(), false);
|
||||||
assert.deepEqual(result.data, expected1);
|
assert.deepStrictEqual(result.data, expected1);
|
||||||
assert.deepEqual(result.found, true);
|
assert.deepStrictEqual(result.found, true);
|
||||||
|
|
||||||
result = await reader.readUntil(limited, 7);
|
result = await reader.readUntil(limited, 7);
|
||||||
|
|
||||||
assert.equal(limited.completed(), true);
|
assert.strictEqual(limited.completed(), true);
|
||||||
assert.deepEqual(result.data, expected2);
|
assert.deepStrictEqual(result.data, expected2);
|
||||||
assert.deepEqual(result.found, false);
|
assert.deepStrictEqual(result.found, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ describe("Sender", () => {
|
|||||||
|
|
||||||
await sendCompleted;
|
await sendCompleted;
|
||||||
|
|
||||||
assert.deepEqual(new Uint8Array(result), expected);
|
assert.deepStrictEqual(new Uint8Array(result), expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Send (Multiple calls)", async () => {
|
it("Send (Multiple calls)", async () => {
|
||||||
@@ -116,6 +116,6 @@ describe("Sender", () => {
|
|||||||
|
|
||||||
await sendCompleted;
|
await sendCompleted;
|
||||||
|
|
||||||
assert.deepEqual(new Uint8Array(result), expected);
|
assert.deepStrictEqual(new Uint8Array(result), expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ const webpack = require("webpack"),
|
|||||||
FaviconsWebpackPlugin = require("favicons-webpack-plugin"),
|
FaviconsWebpackPlugin = require("favicons-webpack-plugin"),
|
||||||
CopyPlugin = require("copy-webpack-plugin"),
|
CopyPlugin = require("copy-webpack-plugin"),
|
||||||
TerserPlugin = require("terser-webpack-plugin"),
|
TerserPlugin = require("terser-webpack-plugin"),
|
||||||
{ CleanWebpackPlugin } = require("clean-webpack-plugin");
|
{ CleanWebpackPlugin } = require("clean-webpack-plugin"),
|
||||||
|
ESLintPlugin = require("eslint-webpack-plugin");
|
||||||
|
|
||||||
const inDevMode = process.env.NODE_ENV === "development";
|
const inDevMode = process.env.NODE_ENV === "development";
|
||||||
|
|
||||||
@@ -281,6 +282,7 @@ module.exports = {
|
|||||||
handlebarsLoader: {},
|
handlebarsLoader: {},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
new ESLintPlugin({}),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user