@gajae-code/utils 0.7.0 → 0.7.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/utils",
4
- "version": "0.7.0",
4
+ "version": "0.7.2",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://gaebal-gajae.dev",
7
7
  "author": "Yeachan-Heo",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@gajae-code/natives": "0.7.0",
34
+ "@gajae-code/natives": "0.7.2",
35
35
  "beautiful-mermaid": "^1.1.3",
36
36
  "handlebars": "^4.7.9",
37
37
  "winston": "^3.19.0",
@@ -1,3 +1,5 @@
1
+ import * as fs from "node:fs";
2
+
1
3
  const CLOSED_STDERR_ERROR_CODES = new Set(["EIO", "EPIPE", "EBADF"]);
2
4
 
3
5
  function isClosedStderrWriteError(error: unknown): boolean {
@@ -6,8 +8,9 @@ function isClosedStderrWriteError(error: unknown): boolean {
6
8
  }
7
9
 
8
10
  export function safeStderrWrite(message: string): void {
11
+ if (!process.stderr.writable) return;
9
12
  try {
10
- process.stderr.write(message);
13
+ fs.writeSync(process.stderr.fd, message);
11
14
  } catch (error) {
12
15
  if (isClosedStderrWriteError(error)) return;
13
16
  throw error;