From c33de0ebbee6a82d46d09d483cc0befbde6f0b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Lian?= Date: Mon, 6 Feb 2017 19:42:19 +0100 Subject: [PATCH] Fix bugs for 1.0.4 --- package.json | 2 +- src/Test.ts | 2 +- src/adapters/Console.ts | 2 +- tsconfig.json | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5bad588..bdda006 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.0.3", + "version": "1.0.4", "name": "escpos-print", "bugs": { "url": "https://github.com/haavardlian/escpos/issues" diff --git a/src/Test.ts b/src/Test.ts index 9d65a3f..397dc17 100644 --- a/src/Test.ts +++ b/src/Test.ts @@ -15,7 +15,7 @@ const values = [ ]; async function test() { - const consoleAdapter = new Console(); + const consoleAdapter = new Console(32); const p = await new Printer(consoleAdapter, "CP865").open(); p.init() .setJustification(Justification.Center) diff --git a/src/adapters/Console.ts b/src/adapters/Console.ts index d13f3ea..e9a7714 100644 --- a/src/adapters/Console.ts +++ b/src/adapters/Console.ts @@ -16,7 +16,7 @@ export default class Console extends Adapter { public write(data: Buffer): Promise { return new Promise((resolve) => { - const regex = new RegExp(`/(.{${this.numbersPerLine * 3}})`, "g"); + const regex = new RegExp(`(.{${this.numbersPerLine * 3}})`, "g"); // tslint:disable-next-line no-console console.log(data.toString("hex").replace(/(.{2})/g, "$1 ").replace(regex, "$1\n")); resolve(); diff --git a/tsconfig.json b/tsconfig.json index 00bb469..5d5064e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,6 @@ "src/adapters/Console.ts", "src/adapters/Network.ts", "src/adapters/Serial.ts", - "src/adapters/PNG.ts", "src/Printer.ts", "src/Commands.ts", "src/Image.ts",