cloudflare-next-intl 0.9.3 → 0.9.5
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.
|
@@ -3,10 +3,19 @@ const ANSI_ESCAPE_CODE_PATTERN = /\x1b\[[0-9;]*m/g;
|
|
|
3
3
|
function stripAnsiCodes(value) {
|
|
4
4
|
return value.replace(ANSI_ESCAPE_CODE_PATTERN, '');
|
|
5
5
|
}
|
|
6
|
+
function isReactInternalReference(value) {
|
|
7
|
+
return typeof value === 'function' && '$$typeof' in value;
|
|
8
|
+
}
|
|
6
9
|
function resolveFunctionError(value) {
|
|
10
|
+
if (isReactInternalReference(value)) {
|
|
11
|
+
return '[React internal reference could not be resolved to a value]';
|
|
12
|
+
}
|
|
7
13
|
let result = value;
|
|
8
14
|
try {
|
|
9
15
|
for (let i = 0; i < MAX_FUNCTION_RESOLUTION_ATTEMPTS && typeof result === 'function'; i++) {
|
|
16
|
+
if (isReactInternalReference(result)) {
|
|
17
|
+
return '[React internal reference could not be resolved to a value]';
|
|
18
|
+
}
|
|
10
19
|
result = result();
|
|
11
20
|
}
|
|
12
21
|
return result;
|