diff --git a/view/tree2/to/dts/dts.ts b/view/tree2/to/dts/dts.ts index c3244d894d7..08a539ea860 100644 --- a/view/tree2/to/dts/dts.ts +++ b/view/tree2/to/dts/dts.ts @@ -113,9 +113,9 @@ namespace $ { ] if( input.type[0] === '/' ) return [ - input.data('readonly '), + input.data('readonly ('), input.type.trim().length > 1 ? input.data( input.type.slice(1) ) : input.data('any'), - input.data('[]'), + input.data(')[]'), ] if( input.type && (input.type.match(/[\+\-]*NaN/) || !Number.isNaN( Number( input.type ) ) ) ) return [ diff --git a/view/tree2/to/js/test/ex/array_channel_with_types.view.tree b/view/tree2/to/js/test/ex/array_channel_with_types.view.tree index 2e5f390be4c..6f53bec5a01 100644 --- a/view/tree2/to/js/test/ex/array_channel_with_types.view.tree +++ b/view/tree2/to/js/test/ex/array_channel_with_types.view.tree @@ -1,2 +1,2 @@ $mol_view_tree2_to_js_test_ex_array_channel_with_types_foo $mol_view - arr /(readonly(number)[]) + arr /readonly(number)[] diff --git a/view/tree2/to/js/test/js.array.test.ts b/view/tree2/to/js/test/js.array.test.ts index 749eccc7f86..ae91680dfc2 100644 --- a/view/tree2/to/js/test/js.array.test.ts +++ b/view/tree2/to/js/test/js.array.test.ts @@ -29,8 +29,9 @@ namespace $ { 'Array channel with types'( $ ) { const _foo = $mol_view_tree2_to_js_test_ex_array_channel_with_types_foo - - $mol_assert_like(_foo.make({ $ }).arr(), []) + const foo = _foo.make({ $ }) + type assert_arr = $mol_type_assert, readonly( readonly(number)[] )[]> + $mol_assert_like(foo.arr(), []) },