mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
fix linting
This commit is contained in:
parent
eda9a40aa2
commit
a0546c8a3d
2 changed files with 22 additions and 14 deletions
|
@ -116,16 +116,22 @@ class Protobuf {
|
|||
return this.mergeDecodes(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse Protobuf stream data
|
||||
* @param {byteArray} input
|
||||
* @param {any[]} args
|
||||
* @returns {any[]}
|
||||
*/
|
||||
static decodeStream(input, args) {
|
||||
this.updateProtoRoot(args[0]);
|
||||
this.showUnknownFields = args[1];
|
||||
this.showTypes = args[2];
|
||||
|
||||
let streams = new Protobuf(input);
|
||||
let output = [];
|
||||
const streams = new Protobuf(input);
|
||||
const output = [];
|
||||
let objLength = streams._varInt();
|
||||
while (!isNaN(objLength) && objLength > 0) {
|
||||
let subData = streams.data.slice(streams.offset, streams.offset + objLength);
|
||||
const subData = streams.data.slice(streams.offset, streams.offset + objLength);
|
||||
output.push(this.mergeDecodes(subData));
|
||||
streams.offset += objLength;
|
||||
objLength = streams._varInt();
|
||||
|
|
|
@ -306,7 +306,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Stream Decode: no schema",
|
||||
input: "0d081c1203596f751a024d65202b0c0a0a0a066162633132331200",
|
||||
expectedOutput: JSON.stringify([{
|
||||
expectedOutput: JSON.stringify([
|
||||
{
|
||||
"1": 28,
|
||||
"2": "You",
|
||||
"3": "Me",
|
||||
|
@ -317,7 +318,8 @@ TestRegister.addTests([
|
|||
"1": "abc123",
|
||||
"2": {}
|
||||
}
|
||||
}], null, 4),
|
||||
}
|
||||
], null, 4),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue