From b90b44eea8d83058fe0bc3325d457739d089da30 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Fri, 20 Oct 2023 00:11:56 +0300 Subject: [PATCH] $mol_view_tree2_to_dts remove arg chars from object prop names --- view/tree2/to/dts/dts.ts | 3 ++- view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts | 4 ++-- .../to/dts/test/bidi_bind_indexed_second_level.test.d.ts | 2 +- .../to/dts/test/bidi_bind_localized_in_object.test.d.ts | 4 ++-- .../to/dts/test/left_bind_in_array_and_object.test.d.ts | 2 +- .../to/dts/test/left_bind_second_level_index.test.d.ts | 2 +- .../left_bind_with_separate_default_and_comment.test.d.ts | 2 +- view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts | 2 +- view/tree2/to/dts/test/right_bind_indexed.test.d.ts | 2 +- view/tree2/to/dts/test/right_bind_read_only.test.d.ts | 2 +- view/tree2/to/dts/test/simple_factory_props.test.d.ts | 6 +++--- 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/view/tree2/to/dts/dts.ts b/view/tree2/to/dts/dts.ts index 9a20efd8181..e9165617576 100644 --- a/view/tree2/to/dts/dts.ts +++ b/view/tree2/to/dts/dts.ts @@ -86,9 +86,10 @@ namespace $ { obj.struct( 'indent', obj.kids.map( field => { if( field.type === '^' ) return null + const field_name = field.type.replace(/\?\w*$/, '') return field.struct( 'line', [ field.data('\''), - field.data( field.type ), + field.data( field_name ), field.data('\''), field.data( ': ' ), ... field.hack( belt ), diff --git a/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts b/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts index 488544bec53..7a352cc8da7 100644 --- a/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts +++ b/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts @@ -2,11 +2,11 @@ declare namespace _bidi_bind_in_dictionary { export class Foo extends $mol_object { event( ): ({ - 'click?': ReturnType< Foo["run"] >, + 'click': ReturnType< Foo["run"] >, }) run( next?: any ): any } } -//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctevent%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctclick%3F%20%3C%3D%3E%20run%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAM%3BAAAA%2CAACL%2CaAAO%2CYAFT%2CGAES%2CEAAI%2CGAAJ%2CIAAP%3BAADK%3BAACM%2CAAAA%2CcAAK%2CGAAL%2CIAAK%3BAAFlB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctevent%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctclick%3F%20%3C%3D%3E%20run%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAM%3BAAAA%2CAACL%2CYAAO%2CYAFT%2CGAES%2CEAAI%2CGAAJ%2CIAAP%3BAADK%3BAACM%2CAAAA%2CcAAK%2CGAAL%2CIAAK%3BAAFlB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts b/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts index 532dd68f738..f2a3a67192e 100644 --- a/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts +++ b/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts @@ -4,7 +4,7 @@ declare namespace _bidi_bind_indexed_second_level { expanded( ): boolean } - type Bar__expanded_D1APEXB5 = $mol_type_enforce< + type Bar__expanded_UPXW21P6 = $mol_type_enforce< ReturnType< Foo["owner"] >, ReturnType< Bar["expanded"] > > diff --git a/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts b/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts index ec9152b6482..df7081c784e 100644 --- a/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts +++ b/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts @@ -2,11 +2,11 @@ declare namespace _bidi_bind_localized_in_object { export class Foo extends $mol_object { obj( ): ({ - 'loc?': ReturnType< Foo["outer"] >, + 'loc': ReturnType< Foo["outer"] >, }) outer( next?: string ): string } } -//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctobj%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc%3F%20%3C%3D%3E%20outer%3F%20%40%20%5C%5Ctest1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CWAAK%2CYAFP%2CGAEO%2CEAAI%2CKAAJ%2CIAAL%3BAADG%3BAACM%2CAAAA%2CgBAAU%2CMAAV%2CIAAU%3BAAFrB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctobj%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc%3F%20%3C%3D%3E%20outer%3F%20%40%20%5C%5Ctest1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CUAAK%2CYAFP%2CGAEO%2CEAAI%2CKAAJ%2CIAAL%3BAADG%3BAACM%2CAAAA%2CgBAAU%2CMAAV%2CIAAU%3BAAFrB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts b/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts index 00600b9d3e4..bef0c11e7a0 100644 --- a/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts +++ b/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts @@ -1,6 +1,6 @@ declare namespace _left_bind_in_array_and_object { - type $mol_object__rows_V83EJ9P9 = $mol_type_enforce< + type $mol_object__rows_Y0ZPGRXV = $mol_type_enforce< ReturnType< Foo["content"] >, ReturnType< $mol_object["rows"] > > diff --git a/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts b/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts index 44697e84dcb..84a0a5154cf 100644 --- a/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts +++ b/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts @@ -1,6 +1,6 @@ declare namespace _left_bind_second_level_index { - type $mol_object__localized_KDIAWS5L = $mol_type_enforce< + type $mol_object__localized_ECYILDJF = $mol_type_enforce< ReturnType< Foo["some"] >, ReturnType< $mol_object["localized"] > > diff --git a/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts b/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts index 8dbe2b3369f..f2aef54de2f 100644 --- a/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts +++ b/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts @@ -1,6 +1,6 @@ declare namespace _left_bind_with_separate_default_and_comment { - type $mol_object__rows_L4S07X4S = $mol_type_enforce< + type $mol_object__rows_7IN1BUGB = $mol_type_enforce< ReturnType< Foo["content"] >, ReturnType< $mol_object["rows"] > > diff --git a/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts b/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts index d8977135ef0..1de40246f4d 100644 --- a/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts +++ b/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts @@ -4,7 +4,7 @@ declare namespace _right_bind_in_left_bind { a( ): any } - type Foo__a_UIYUO0JW = $mol_type_enforce< + type Foo__a_5ZQWI0UX = $mol_type_enforce< ReturnType< Bar["b"] >, ReturnType< Foo["a"] > > diff --git a/view/tree2/to/dts/test/right_bind_indexed.test.d.ts b/view/tree2/to/dts/test/right_bind_indexed.test.d.ts index 90b38740092..7700d440c1a 100644 --- a/view/tree2/to/dts/test/right_bind_indexed.test.d.ts +++ b/view/tree2/to/dts/test/right_bind_indexed.test.d.ts @@ -8,7 +8,7 @@ declare namespace _right_bind_indexed { }) } - type Foo__a_QYLYNT1E = $mol_type_enforce< + type Foo__a_9T0KZJNH = $mol_type_enforce< ReturnType< Bar["b"] >, ReturnType< Foo["a"] > > diff --git a/view/tree2/to/dts/test/right_bind_read_only.test.d.ts b/view/tree2/to/dts/test/right_bind_read_only.test.d.ts index 219673c5762..3f0f569b028 100644 --- a/view/tree2/to/dts/test/right_bind_read_only.test.d.ts +++ b/view/tree2/to/dts/test/right_bind_read_only.test.d.ts @@ -4,7 +4,7 @@ declare namespace _right_bind_read_only { a( id: any, next?: any ): any } - type Foo__a_2HF0Z2KM = $mol_type_enforce< + type Foo__a_OWGUONH0 = $mol_type_enforce< ReturnType< Bar["b"] >, ReturnType< Foo["a"] > > diff --git a/view/tree2/to/dts/test/simple_factory_props.test.d.ts b/view/tree2/to/dts/test/simple_factory_props.test.d.ts index 8db7733c808..787e99cf833 100644 --- a/view/tree2/to/dts/test/simple_factory_props.test.d.ts +++ b/view/tree2/to/dts/test/simple_factory_props.test.d.ts @@ -1,14 +1,14 @@ declare namespace _simple_factory_props { - type $mol_object__some_ODAWC5JF = $mol_type_enforce< + type $mol_object__some_NIWV42PT = $mol_type_enforce< boolean, ReturnType< $mol_object["some"] > > - type $mol_object__loc_UDO07ACF = $mol_type_enforce< + type $mol_object__loc_SAA9OV61 = $mol_type_enforce< string, ReturnType< $mol_object["loc"] > > - type $mol_object__sub_XVYAJKRH = $mol_type_enforce< + type $mol_object__sub_E1IRQUFO = $mol_type_enforce< readonly any[], ReturnType< $mol_object["sub"] > >