Skip to content

Commit acd2e72

Browse files
committed
fix linting
1 parent 0cfbc40 commit acd2e72

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/core/lib/Protobuf.mjs

+9-3
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,22 @@ class Protobuf {
116116
return this.mergeDecodes(input);
117117
}
118118

119+
/**
120+
* Parse Protobuf stream data
121+
* @param {byteArray} input
122+
* @param {any[]} args
123+
* @returns {any[]}
124+
*/
119125
static decodeStream(input, args) {
120126
this.updateProtoRoot(args[0]);
121127
this.showUnknownFields = args[1];
122128
this.showTypes = args[2];
123129

124-
let streams = new Protobuf(input);
125-
let output = [];
130+
const streams = new Protobuf(input);
131+
const output = [];
126132
let objLength = streams._varInt();
127133
while (!isNaN(objLength) && objLength > 0) {
128-
let subData = streams.data.slice(streams.offset, streams.offset + objLength);
134+
const subData = streams.data.slice(streams.offset, streams.offset + objLength);
129135
output.push(this.mergeDecodes(subData));
130136
streams.offset += objLength;
131137
objLength = streams._varInt();

tests/operations/tests/Protobuf.mjs

+13-11
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,20 @@ TestRegister.addTests([
306306
{
307307
name: "Protobuf Stream Decode: no schema",
308308
input: "0d081c1203596f751a024d65202b0c0a0a0a066162633132331200",
309-
expectedOutput: JSON.stringify([{
310-
"1": 28,
311-
"2": "You",
312-
"3": "Me",
313-
"4": 43
314-
},
315-
{
316-
"1": {
317-
"1": "abc123",
318-
"2": {}
309+
expectedOutput: JSON.stringify([
310+
{
311+
"1": 28,
312+
"2": "You",
313+
"3": "Me",
314+
"4": 43
315+
},
316+
{
317+
"1": {
318+
"1": "abc123",
319+
"2": {}
320+
}
319321
}
320-
}], null, 4),
322+
], null, 4),
321323
recipeConfig: [
322324
{
323325
"op": "From Hex",

0 commit comments

Comments
 (0)