From 145e2ca2cb79245205d60a72c78459e8b3a3cd58 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 24 Jun 2018 00:26:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Allow=20output=20to=20console=20?= =?UTF-8?q?for=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/bencodeParser.ts | 6 +++--- src/tslint.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ssn/bencodeParser.ts b/src/ssn/bencodeParser.ts index 37aefc1..2d9a0e2 100644 --- a/src/ssn/bencodeParser.ts +++ b/src/ssn/bencodeParser.ts @@ -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; diff --git a/src/tslint.json b/src/tslint.json index 426f4e5..6a41014 100644 --- a/src/tslint.json +++ b/src/tslint.json @@ -9,6 +9,7 @@ "indent": [true, "spaces", 2], "max-line-length": false, "no-bitwise": false, + "no-console": false, "quotemark": [true, "single"] }, "rulesDirectory": []