Skip to content

Commit b6ac6b4

Browse files
committed
modofy indent and fix #34 , #36 .
1 parent 34c7b5e commit b6ac6b4

File tree

4 files changed

+912
-21
lines changed

4 files changed

+912
-21
lines changed

commands.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,13 @@ _.BARCODE_FORMAT = {
137137
BARCODE_HEIGHT : function(height){ // Barcode Height [1-255]
138138
return '\x1d\x68'+String.fromCharCode(height);
139139
},
140-
BARCODE_WIDTH : { // Barcode Width [2-6]
141-
1: '\x1d\x77\x02',
142-
2: '\x1d\x77\x03',
143-
3: '\x1d\x77\x04',
144-
4: '\x1d\x77\x05',
145-
5: '\x1d\x77\x06'
140+
// Barcode Width [2-6]
141+
BARCODE_WIDTH : {
142+
1: '\x1d\x77\x02',
143+
2: '\x1d\x77\x03',
144+
3: '\x1d\x77\x04',
145+
4: '\x1d\x77\x05',
146+
5: '\x1d\x77\x06',
146147
},
147148
BARCODE_HEIGHT_DEFAULT : '\x1d\x77\x64', // Barcode height default:100
148149
BARCODE_WIDTH_DEFAULT : '\x1d\x77\x03', // Barcode width default:3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "escpos",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "ESC/POS Printer driver for nodejs",
55
"main": "index.js",
66
"scripts": {

printer.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -227,32 +227,21 @@ Printer.prototype.style = function(type){
227227
* @return {[Printer]} printer [description]
228228
*/
229229
Printer.prototype.size = function(width, height) {
230-
231230
if (2 >= width && 2 >= height) {
232-
233231
this.buffer.write(_.TEXT_FORMAT.TXT_NORMAL);
234-
235232
if (2 == width && 2 == height) {
236233
this.buffer.write(_.TEXT_FORMAT.TXT_4SQUARE);
237-
}
238-
else if (1 == width && 2 == height) {
234+
} else if (1 == width && 2 == height) {
239235
this.buffer.write(_.TEXT_FORMAT.TXT_2HEIGHT);
240-
}
241-
else if (2 == width && 1 == height) {
236+
} else if (2 == width && 1 == height) {
242237
this.buffer.write(_.TEXT_FORMAT.TXT_2WIDTH);
243238
}
244-
245-
}
246-
else {
247-
239+
} else {
248240
this.buffer.write(_.TEXT_FORMAT.TXT_SIZE);
249241
this.buffer.write(_.TEXT_FORMAT.TXT_WIDTH[(8 >= width) ? width : 8]);
250242
this.buffer.write(_.TEXT_FORMAT.TXT_HEIGHT[(8 >= height) ? height : 8]);
251-
252243
}
253-
254244
return this;
255-
256245
};
257246

258247
/**

0 commit comments

Comments
 (0)