@adecore/utils 0.54.1 → 0.54.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @adecore/utils
2
2
 
3
- Small helpers without dependencies: atomic file writes, path containment, the order of async work and reading a thrown value. Each lives at its own subpath; `async`, `errors`, `record` and `text` run in a page, `fs` and `path` need Node or Bun.
3
+ Small helpers without dependencies: atomic file writes, path containment, the order of async work and reading a thrown value. Each lives at its own subpath. `async`, `errors`, `record` and `text` run in a page; `fs` and `path` need Node or Bun.
4
4
 
5
5
  ```sh
6
6
  bun add @adecore/utils
package/dist/errors.js CHANGED
@@ -10,9 +10,8 @@ export function isNotFound(e) {
10
10
  return hasErrorCode(e, 'ENOENT');
11
11
  }
12
12
  /*
13
- * The message of an error, or its whole stack with `debug` set. Bun prints an Error object handed to the
14
- * console with a code frame of the bundle it came from, which in a compiled binary is a few lines of
15
- * minified source, so an error is turned into a string first.
13
+ * The message of an error, or its whole stack with `debug` set. Bun prints an Error object with a code
14
+ * frame of its bundle, which in a compiled binary is a few lines of minified source. A string avoids that.
16
15
  */
17
16
  export function describeError(error, debug) {
18
17
  if (!(error instanceof Error)) {
package/dist/fs.js CHANGED
@@ -129,7 +129,7 @@ export function writeAtomicSync(target, content, mode = 0o600) {
129
129
  }
130
130
  }
131
131
  }
132
- // Bun on Windows fails a forced rm with EFAULT while another delete of the same file is pending; it goes either way.
132
+ // Bun on Windows fails a forced rm with EFAULT while another delete of the same file is pending. That delete removes it anyway.
133
133
  export async function removeFile(path, remove = rm) {
134
134
  try {
135
135
  await remove(path, { force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/utils",
3
- "version": "0.54.1",
3
+ "version": "0.54.3",
4
4
  "description": "Small helpers without dependencies: atomic file writes, path containment, async ordering and error reading.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "author": "Bas Milius",
package/src/errors.ts CHANGED
@@ -13,9 +13,8 @@ export function isNotFound(e: unknown): boolean {
13
13
  }
14
14
 
15
15
  /*
16
- * The message of an error, or its whole stack with `debug` set. Bun prints an Error object handed to the
17
- * console with a code frame of the bundle it came from, which in a compiled binary is a few lines of
18
- * minified source, so an error is turned into a string first.
16
+ * The message of an error, or its whole stack with `debug` set. Bun prints an Error object with a code
17
+ * frame of its bundle, which in a compiled binary is a few lines of minified source. A string avoids that.
19
18
  */
20
19
  export function describeError(error: unknown, debug: boolean): string {
21
20
  if (!(error instanceof Error)) {
package/src/fs.ts CHANGED
@@ -151,7 +151,7 @@ export function writeAtomicSync(target: string, content: string | Uint8Array, mo
151
151
  }
152
152
  }
153
153
 
154
- // Bun on Windows fails a forced rm with EFAULT while another delete of the same file is pending; it goes either way.
154
+ // Bun on Windows fails a forced rm with EFAULT while another delete of the same file is pending. That delete removes it anyway.
155
155
  export async function removeFile(path: string, remove: (path: string, options: { force: true }) => Promise<void> = rm): Promise<void> {
156
156
  try {
157
157
  await remove(path, { force: true });