@poe-platform/safe-fs 0.1.428 → 0.1.430

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.
@@ -2,9 +2,17 @@ import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import * as util from "node:util";
4
4
  import { constants } from "node:os";
5
- const systemErrnos = typeof util.getSystemErrorMap === "function"
6
- ? new Map([...util.getSystemErrorMap()].map(([errno, [name]]) => [name, errno]))
7
- : new Map(Object.entries(constants.errno).map(([name, errno]) => [name, -Math.abs(errno)]));
5
+ const systemErrnos = (() => {
6
+ const fallback = new Map(Object.entries(constants.errno).map(([name, errno]) => [name, -Math.abs(errno)]));
7
+ if (typeof util.getSystemErrorMap !== "function")
8
+ return fallback;
9
+ try {
10
+ return new Map([...util.getSystemErrorMap()].map(([errno, [name]]) => [name, errno]));
11
+ }
12
+ catch {
13
+ return fallback;
14
+ }
15
+ })();
8
16
  const negotiating = new AsyncLocalStorage();
9
17
  export const platform = Object.freeze({
10
18
  errno(code) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-fs",
3
- "version": "0.1.428",
3
+ "version": "0.1.430",
4
4
  "description": "Composable filesystem with a portable core and explicit Node adapters",
5
5
  "type": "module",
6
6
  "license": "MIT",