@xuda.io/runtime-bundle 1.0.1433 → 1.0.1434
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.
|
@@ -37435,8 +37435,16 @@ func.runtime.render.build_base_xu_handlers = function (options, _ds) {
|
|
|
37435
37435
|
const parse_object_value = function (attr_name, val, shape = 'object') {
|
|
37436
37436
|
let parsed_value = val?.value;
|
|
37437
37437
|
if (typeof parsed_value === 'string') {
|
|
37438
|
+
const trimmed_value = parsed_value.trim();
|
|
37439
|
+
const wrapped_candidate =
|
|
37440
|
+
trimmed_value.startsWith('(') && trimmed_value.endsWith(')')
|
|
37441
|
+
? trimmed_value.slice(1, -1).trim()
|
|
37442
|
+
: trimmed_value;
|
|
37443
|
+
const looks_like_wrapped_shape =
|
|
37444
|
+
(shape === 'object' && wrapped_candidate.startsWith('{') && wrapped_candidate.endsWith('}')) ||
|
|
37445
|
+
(shape === 'array' && wrapped_candidate.startsWith('[') && wrapped_candidate.endsWith(']'));
|
|
37438
37446
|
try {
|
|
37439
|
-
parsed_value = JSON5.parse(
|
|
37447
|
+
parsed_value = JSON5.parse(looks_like_wrapped_shape ? wrapped_candidate : trimmed_value);
|
|
37440
37448
|
} catch (error) {
|
|
37441
37449
|
throw func.runtime.render.build_xu_runtime_error(
|
|
37442
37450
|
{ ...options, xu_func: attr_name, val: { key: attr_name, value: val?.value } },
|