cloudflare-next-intl 0.6.22 → 0.6.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.
@@ -2,9 +2,8 @@
2
2
  * Safely converts an `unknown` value (typically `ErrorHandlingParams.error`)
3
3
  * into a string, for logging/dedup-keying/display — never throws.
4
4
  *
5
- * @param isClient Skips resolving function-wrapped/lazy error values on the
6
- * client (matches `ErrorHandlingParams.isClient`) running arbitrary
7
- * caught functions client-side isn't safe the way it is on the server.
5
+ * @param isClient Matches `ErrorHandlingParams.isClient`; forwarded to nested
6
+ * `stringifyUnknown` calls when resolving a function-wrapped error.
8
7
  * @param isNested Set when stringifying a value nested inside another
9
8
  * object/array — falls back to a plain `JSON.stringify` (no pretty-print)
10
9
  * so a single unserializable nested value can't crash the whole report.
@@ -14,16 +14,17 @@ function resolveFunctionError(value) {
14
14
  return result;
15
15
  }
16
16
  catch (error) {
17
- return `Error during function resolution: ${String(error)}`;
17
+ const message = `Error during function resolution: ${String(error)}`;
18
+ console.warn(message);
19
+ return message;
18
20
  }
19
21
  }
20
22
  /**
21
23
  * Safely converts an `unknown` value (typically `ErrorHandlingParams.error`)
22
24
  * into a string, for logging/dedup-keying/display — never throws.
23
25
  *
24
- * @param isClient Skips resolving function-wrapped/lazy error values on the
25
- * client (matches `ErrorHandlingParams.isClient`) running arbitrary
26
- * caught functions client-side isn't safe the way it is on the server.
26
+ * @param isClient Matches `ErrorHandlingParams.isClient`; forwarded to nested
27
+ * `stringifyUnknown` calls when resolving a function-wrapped error.
27
28
  * @param isNested Set when stringifying a value nested inside another
28
29
  * object/array — falls back to a plain `JSON.stringify` (no pretty-print)
29
30
  * so a single unserializable nested value can't crash the whole report.
@@ -34,8 +35,6 @@ export default function stringifyUnknown(value, isClient, isNested = false) {
34
35
  if (value instanceof Error)
35
36
  return stripAnsiCodes(`${value.name}: ${value.message}\n\n${value.stack ?? ''}`);
36
37
  if (typeof value === 'function') {
37
- if (isClient)
38
- return '[Function]';
39
38
  const resolved = resolveFunctionError(value);
40
39
  return typeof resolved !== 'function' ? stringifyUnknown(resolved, isClient) : '[Function]';
41
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.6.22",
3
+ "version": "0.6.24",
4
4
  "description": "Optimized Next Intl Package Special for App Router and Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",