File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -1390,8 +1390,10 @@ export class LuaTransformer {
13901390 const elements = pattern . elements as ts . NodeArray < ts . BindingElement > ;
13911391 const usedProperties = elements . map ( e =>
13921392 tstl . createTableFieldExpression (
1393+ tstl . createBooleanLiteral ( true ) ,
13931394 tstl . createStringLiteral (
1394- this . getIdentifierText ( ( e . propertyName || e . name ) as ts . Identifier )
1395+ this . getIdentifierText ( ( e . propertyName || e . name ) as ts . Identifier ) ,
1396+ e . propertyName || e . name
13951397 )
13961398 )
13971399 ) ;
Original file line number Diff line number Diff line change 11function __TS__ObjectRest < K extends keyof any , V > (
22 this : void ,
33 target : Record < K , V > ,
4- usedProperties : K [ ]
4+ usedProperties : Partial < Record < K , true > >
55) : Partial < Record < K , V > > {
66 const result : Partial < Record < K , V > > = { } ;
77 for ( const property in target ) {
8- let isUsed = false ;
9- for ( const usedProperty of usedProperties ) {
10- if ( property === usedProperty ) {
11- isUsed = true ;
12- break ;
13- }
14- }
15-
16- if ( ! isUsed ) {
8+ if ( ! usedProperties [ property ] ) {
179 result [ property ] = target [ property ] ;
1810 }
1911 }
You can’t perform that action at this time.
0 commit comments