terminal-pilot 0.0.22 → 0.0.24

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.
@@ -799,6 +799,11 @@ function parseAnsi(input) {
799
799
  return buildRuns(lines, lineBreakStyles);
800
800
  }
801
801
 
802
+ // ../terminal-png/src/error-codes.ts
803
+ function hasOwnErrorCode(error, code) {
804
+ return typeof error === "object" && error !== null && Object.prototype.hasOwnProperty.call(error, "code") && error.code === code;
805
+ }
806
+
802
807
  // ../terminal-png/src/png-renderer.ts
803
808
  import { Resvg } from "@resvg/resvg-js";
804
809
 
@@ -1372,7 +1377,7 @@ async function renderTerminalPng(ansiText, options = {}) {
1372
1377
  return png;
1373
1378
  }
1374
1379
  function isAlreadyExistsError(error) {
1375
- return error instanceof Error && Object.prototype.hasOwnProperty.call(error, "code") && error.code === "EEXIST";
1380
+ return error instanceof Error && hasOwnErrorCode(error, "EEXIST");
1376
1381
  }
1377
1382
 
1378
1383
  // src/terminal-pilot.ts
@@ -1459,7 +1464,7 @@ function consumeTerminatedString(input, index, allowBellTerminator) {
1459
1464
  }
1460
1465
 
1461
1466
  // src/errors.ts
1462
- function hasOwnErrorCode(error, code) {
1467
+ function hasOwnErrorCode2(error, code) {
1463
1468
  return error instanceof Error && Object.prototype.hasOwnProperty.call(error, "code") && error.code === code;
1464
1469
  }
1465
1470
 
@@ -2562,7 +2567,7 @@ function ensureSpawnHelperExecutable() {
2562
2567
  }
2563
2568
  }
2564
2569
  function isMissingFileError(error) {
2565
- return hasOwnErrorCode(error, "ENOENT");
2570
+ return hasOwnErrorCode2(error, "ENOENT");
2566
2571
  }
2567
2572
  function matchPattern(buffer, pattern) {
2568
2573
  const clean = normalizeHistoryBuffer(stripAnsi(buffer));