File tree Expand file tree Collapse file tree
scripts/convert-to-typescript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ export function createInterfaceDefinition(
1414 interfaceName : string ,
1515 interfaceToProcess : InterfaceToProcess ,
1616 project : Project ,
17- depth = 0 ,
1817) : void {
1918 let interfaceDefinition = context . interfaceDefinitions . get ( interfaceName ) ;
2019
@@ -34,7 +33,7 @@ export function createInterfaceDefinition(
3433 } ;
3534
3635 // Get all properties
37- let properties = getProperties ( interfaceToProcess . obj , depth ) ;
36+ let properties = getProperties ( interfaceToProcess . obj ) ;
3837
3938 // Check if object is a protobuf message
4039 if ( properties . includes ( 'toObject' ) && properties . includes ( 'serializeBinary' ) && properties . includes ( 'getClassName' ) ) {
Original file line number Diff line number Diff line change @@ -59,17 +59,13 @@ export function formatInterfaceName(interfaceName: string): string {
5959 * and returns them as an array, excluding default prototype properties.
6060 * This also includes all functions
6161 */
62- export function getProperties ( obj : unknown , depth = 0 ) : string [ ] {
62+ export function getProperties ( obj : unknown ) : string [ ] {
6363 if ( obj === null || typeof obj !== 'object' ) return [ ] ;
6464 if ( obj [ Symbol . toStringTag ] !== undefined ) return [ 'values' ] ;
6565
6666 const properties = new Set < string > ( ) ;
6767 let currentObj : object | null = obj ;
6868
69- // for (let i = 0; i < depth; i++) {
70- // currentObj = Object.getPrototypeOf(currentObj) as object | null;
71- // }
72-
7369 do {
7470 const ownProps = Object . getOwnPropertyNames ( currentObj ) ;
7571 ownProps . forEach ( ( propName ) => {
You can’t perform that action at this time.
0 commit comments