🚨 Allow output to console for now

This commit is contained in:
C-3PO 2018-06-24 00:26:41 +02:00
parent 5fd25d1095
commit 145e2ca2cb
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 4 additions and 3 deletions

View file

@ -19,7 +19,7 @@ function bpParse(dv: DataView, posIn: number = 0): { obj: any, pos: number } {
const out1 = bpParse(dv, pos);
pos = out1.pos;
if (typeof out1.obj !== 'string') {
throw new Error(`Expected dictionary key to be string but it is "${typeof out1.obj}"`);
throw new Error(`Expected dictionary key to be string but it is "${typeof out1.obj}".`);
}
//read value
const out2 = bpParse(dv, pos);
@ -45,7 +45,7 @@ function bpParse(dv: DataView, posIn: number = 0): { obj: any, pos: number } {
let curNumber = 0;
while (curChar !== 0x65) { //'e' - end
if (curChar < 0x30 || curChar > 0x39) {
throw new Error('Unexpected int char during bencode parsing');
throw new Error('Unexpected int char during bencode parsing.');
}
curNumber *= 10;
curNumber += curChar - 0x30;
@ -61,7 +61,7 @@ function bpParse(dv: DataView, posIn: number = 0): { obj: any, pos: number } {
let strLen = 0;
while (curChar !== 0x3A) { //':' - integer delimiter, beginning of string
if (curChar < 0x30 || curChar > 0x39) {
throw new Error('Unexpected string length during bencode parsing');
throw new Error('Unexpected string length during bencode parsing.');
}
strLen *= 10;
strLen += curChar - 0x30;

View file

@ -9,6 +9,7 @@
"indent": [true, "spaces", 2],
"max-line-length": false,
"no-bitwise": false,
"no-console": false,
"quotemark": [true, "single"]
},
"rulesDirectory": []