windsor-bot 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/printer.js CHANGED
@@ -57,12 +57,7 @@ function chooseFontForLines(totalLines) {
57
57
  }
58
58
  }
59
59
  function countLayoutLines(lines) {
60
- const longestLine = lines.reduce((max, line) => Math.max(max, line.length), 0);
61
- return longestLine > CHARS_DOUBLE
62
- ? 9
63
- : lines.length <= 2
64
- ? 2
65
- : lines.length;
60
+ return lines.length <= 2 ? 2 : lines.length;
66
61
  }
67
62
  export async function getConnectedPrinter() {
68
63
  // Try CUPS first
@@ -35,12 +35,7 @@ function chooseFontForLines(totalLines) {
35
35
  }
36
36
  }
37
37
  function countLayoutLines(lines) {
38
- const longestLine = lines.reduce((max, line) => Math.max(max, line.length), 0);
39
- return longestLine > COLS_DOUBLE
40
- ? 9
41
- : lines.length <= 2
42
- ? 2
43
- : lines.length;
38
+ return lines.length <= 2 ? 2 : lines.length;
44
39
  }
45
40
  export async function buildEscpBuffer(job) {
46
41
  const conn = new InMemory();
@@ -22,12 +22,7 @@ function chooseLineHeight(totalLines) {
22
22
  return { lineHeight: LINE_HEIGHT_NORMAL, fontPath: FONT_16 };
23
23
  }
24
24
  function countLayoutLines(lines) {
25
- const longestLine = lines.reduce((max, line) => Math.max(max, line.length), 0);
26
- return longestLine > 24
27
- ? 9
28
- : lines.length <= 2
29
- ? 2
30
- : lines.length;
25
+ return lines.length <= 2 ? 2 : lines.length;
31
26
  }
32
27
  function wrapText(text, font, maxWidth) {
33
28
  if (!text)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windsor-bot",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Self-hosted Discord bot automation for household list and todo printing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",